阿里云百炼大模型平台-自定义插件接口协议报错排查方案

本文涉及的产品
RDS DuckDB + QuickBI 企业套餐,8核32GB + QuickBI 专业版
简介: 阿里云百炼大模型平台-自定义插件接口协议报错排查方案

1. 原始openapi specification

openapi: 3.0.1
info:
    title: 小助手
    description: 根据用户输入信息,进行测试
    version: "v2"
servers:
    - url: https://aaa.bbb.com/api/forward
components:
    responses:
        UError:
            description: Bearer token缺失或无效
            content:
                application/json:
                    schema:
                        type: object
                        properties:
                            code:
                                type: integer
                                example: 401
                            message:
                                type: string
                                example: "接口权限校验失败"
        SunError:
            description: 业务异常
            content:
                application/json:
                    schema:
                        type: object
                        properties:
                            code:
                                type: integer
                                example: 0
                            message:
                                type: string
                                example: "业务异常"
paths:
    /forward:
        post:
            operationId: aaa
            summary: 根据用户输入信息,进行测试
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            required: [server_flag, server_dir, params]
                            properties:
                                server_flag:
                                    type: string
                                    description: descaaabbbccc
                                    example: "testddd"
                                server_dir:
                                    type: string
                                    description: descddd
                                    example: "Aaaa.bbbb"
                                params:
                                    type: object
                                    description: 第三方所需参数
                                    properties:
                                        clntManagerId:
                                            type: string
                                            description: col1
                                            example: "0d06099fed39eb683782fa104dd33998"
                                        cumerName: 
                                            type: string
                                            description: col2
                                            example: "xxx"
                                        cumerPhone:
                                            type: string
                                            description: col3
                                            example: "123123123"
                                        dlerCode: 
                                            type: string
                                            description: col4
                                            example: "8f52d344eab7fec87e1bb168898ba494"
                                        proctSeries:
                                            type: string
                                            description: col5
                                            example: "D"
                                        rerveTime: 
                                            type: string
                                            description: col6
                                            example: "2024-06-21 15:30"
            responses:
                "200":
                    description: 成功
                    content:
                        application/json:
                            schema:
                                type: object
                                required: [code, message, data]
                                properties:
                                    code:
                                        type: integer
                                        example: 200
                                    message:
                                        type: string
                                        example: "ok"
                                    data:
                                        type: object
                                        properties:
                                            CODE:
                                                type: integer
                                                example: 200
                                            DATA:
                                                type: object
                                                properties:
                                                    eventId:
                                                        type: string
                                                        example: "062e0xxx71a1dde"
                                                eventId:
                                                    type: string
                                                    example: "cdce6xxx13123"
                                            RESULT:
                                                type: string
                                                example: ""
                '401':
                    $ref: '#/path1/path2/U1Error'
                '0':
                    $ref: '#/path1/path2/SuError'

2. 报错

INVALID PARAMETER: apiScheme definition is invalid

3. 排查过程

参考文档排查具体报错:https://editor.swagger.io/

  1. 右侧有这个配置文件具体的报错情况,点击具体报错可以跳转到具体行。第一个可以明显看出74行有个中文冒号,key的颜色都没有匹配上,改成英文冒号后正常

image.png

  1. 修改后可以看到第二个报错,点击跳转后可以到具体报错的地方,这里是仅支持三位的状态码,配置文件中有个状态码是“0”,改成“400”后正常

image.png

  1. 继续修改后可以看到后面的报错,如下路径(可以直接点击跳转到DATA)下,有个名为“eventId”的额外的配置项是不被允许的,仔细看发现配置在properties里面的eventId应该是粘贴重复且层级错误了,去掉后正常。

image.png

  1. 具体状态码的ref需要时文件中已经配置合法的location,这里需要改成对应的如:'#/components/responses/UError'

image.png

4. 修改后的openapi specification

openapi: 3.0.1
info:
    title: 小助手
    description: 根据用户输入信息,进行测试
    version: "v2"
servers:
    - url: https://aaa.bbb.com/api/forward
components:
    # securitySchemes:
    #     BearerAuth:
    #         type: http
    #         scheme: bearer
    #         bearerFormat: JWT
    responses:
        UError:
            description: Bearer token缺失或无效
            content:
                application/json:
                    schema:
                        type: object
                        properties:
                            code:
                                type: integer
                                example: 401
                            message:
                                type: string
                                example: "接口权限校验失败"
        SunError:
            description: 业务异常
            content:
                application/json:
                    schema:
                        type: object
                        properties:
                            code:
                                type: integer
                                example: 0
                            message:
                                type: string
                                example: "业务异常"
paths:
    /forward:
        post:
            operationId: aaa
            summary: 根据用户输入信息,进行测试
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            required: [server_flag, server_dir, params]
                            properties:
                                server_flag:
                                    type: string
                                    description: descaaabbbccc
                                    example: "testddd"
                                server_dir:
                                    type: string
                                    description: descddd
                                    example: "Aaaa.bbbb"
                                params:
                                    type: object
                                    description: 第三方所需参数
                                    properties:
                                        clntManagerId:
                                            type: string
                                            description: col1
                                            example: "0d06099fed39eb683782fa104dd33998"
                                        cumerName: 
                                            type: string
                                            description: col2
                                            example: "xxx"
                                        cumerPhone:
                                            type: string
                                            description: col3
                                            example: "123123123"
                                        dlerCode: 
                                            type: string
                                            description: col4
                                            example: "8f52d344eab7fec87e1bb168898ba494"
                                        proctSeries:
                                            type: string
                                            description: col5
                                            example: "D"
                                        rerveTime: 
                                            type: string
                                            description: col6
                                            example: "2024-06-21 15:30"
            responses:
                "200":
                    description: 成功
                    content:
                        application/json:
                            schema:
                                type: object
                                required: [code, message, data]
                                properties:
                                    code:
                                        type: integer
                                        example: 200
                                    message:
                                        type: string
                                        example: "ok"
                                    data:
                                        type: object
                                        properties:
                                            CODE:
                                                type: integer
                                                example: 200
                                            DATA:
                                                type: object
                                                properties:
                                                    eventId:
                                                        type: string
                                                        example: "062e0xxx71a1dde"
                                            RESULT:
                                                type: string
                                                example: ""
                '401':
                    $ref: '#/components/responses/UError'
                '400':
                    $ref: '#/components/responses/SunError'
相关文章
|
10月前
|
存储 人工智能 文字识别
医疗病历结构化处理系统技术白皮书——基于多模态AI的医联体数据治理方案
本系统基于双端协同架构,集成移动端OCR识别与云端数据分析,实现医疗文档高效结构化处理。采用PaddleOCR轻量引擎与隐私计算技术,支持离线识别与敏感信息脱敏。后端构建分布式数据仓库与多租户机制,满足PB级存储与数据安全合规要求。实测OCR准确率达96.2%(印刷体)与88.7%(手写体),字段抽取F1值92.4%,显著提升病历处理效率与质量。
1051 3
|
8月前
|
人工智能 缓存 自然语言处理
阿里云百炼大模型收费说明:模型推理、模型训练和模型部署费用整理
阿里云百炼平台开通免费,且每模型享100万Token免费额度。费用产生于模型推理、训练(调优)和部署,超出免费额度后按量计费。推理按输入/输出Token阶梯计价,训练按数据量和循环次数计费,部署支持按时长或调用量两种模式。
3977 65
|
12月前
|
人工智能 自然语言处理 算法
AI智能混剪视频大模型开发方案:从文字到视频的自动化生成·优雅草卓伊凡
AI智能混剪视频大模型开发方案:从文字到视频的自动化生成·优雅草卓伊凡
1570 0
AI智能混剪视频大模型开发方案:从文字到视频的自动化生成·优雅草卓伊凡
|
7月前
|
存储 监控 算法
1688 图片搜索逆向实战:CLIP 多模态融合与特征向量落地方案
本文分享基于CLIP模型与逆向工程实现1688图片搜同款的实战方案。通过抓包分析破解接口签名,结合CLIP多模态特征提取与Faiss向量检索,提升搜索准确率至91%,单次响应低于80ms,日均选品效率提升4倍,全程合规可复现。
|
8月前
|
人工智能 自然语言处理 语音技术
阿里云百炼官网首页登录入口:开通百炼,每个大模型免费100万Tokens
阿里云百炼平台现开放免费领Token福利,开通即享超5000万额度。提供大模型推理、部署及训练服务,涵盖通义千问、万相等多个系列模型。前台介绍平台详情与价格,后台支持API-Key申请及管理操作。
3066 8
|
8月前
|
人工智能 API
阿里云百炼API-KEY在哪查询?如何获取阿里云AI百炼大模型的API-KEY?
阿里云百炼是阿里云推出的AI大模型平台,用户可通过其管理控制台获取API-KEY。需先开通百炼平台及大模型服务,即可创建并复制API-KEY。目前平台提供千万tokens免费额度,详细操作流程可参考官方指引。
|
11月前
|
机器学习/深度学习 资源调度 算法
Kaggle金牌方案复现:CGO-Transformer-GRU多模态融合预测实战
本文详细介绍了在2023年Kaggle "Global Multimodal Demand Forecasting Challenge"中夺冠的**CGO-Transformer-GRU**方案。该方案通过融合协方差引导优化(CGO)、注意力机制和时序建模技术,解决了多模态数据预测中的核心挑战,包括异构数据对齐、模态动态变化及长短期依赖建模。方案创新性地提出了动态门控机制、混合架构和梯度平衡算法,并在公开数据集TMU-MDFD上取得了RMSE 7.83的优异成绩,领先亚军12.6%。
592 1
|
11月前
|
JSON 数据格式
本地部署的qwen3-8b模型和百炼上的qwen3-8b模型效果不一致
我在使用Function Call时发现,百炼平台上的Qwen3-8B模型与本地部署的Qwen3-8B模型效果存在差异,主要体现在函数参数生成上,本地模型常出现漏参或JSON格式错误,而百炼模型表现正常。想确认百炼平台的Qwen3-8B是否为更高版本?
1836 1