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

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

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'
相关文章
|
6月前
|
机器学习/深度学习 数据采集 人工智能
通义实验室Mobile-Agent-v3开源,全平台SOTA的GUI智能体,支持手机电脑等多平台交互
近日,通义实验室MobileAgent团队正式开源全新图形界面交互基础模型 GUI-Owl,并同步推出支持多智能体协同的自动化框架 Mobile-Agent-v3。该模型基于Qwen2.5-VL打造,在手机端与电脑端共8个GUI任务榜单中全面刷新开源模型性能纪录,达成全平台SOTA。
2009 2
|
7月前
|
传感器 边缘计算 人工智能
2025大模型应用平台选型指南:从个人助手到企业级智能体,5大平台场景化拆解
本文深度评测五大主流大模型平台,结合金融、医疗、制造实战案例,解析Open WebUI、Dify、Ragflow、FastGPT与n8n的定位与优势,提供选型决策树与混合架构实例,助你精准匹配业务需求,避开“全能平台”陷阱,实现高效智能化落地。
|
6月前
|
人工智能 缓存 自然语言处理
阿里云百炼大模型收费说明:模型推理、模型训练和模型部署费用整理
阿里云百炼平台开通免费,且每模型享100万Token免费额度。费用产生于模型推理、训练(调优)和部署,超出免费额度后按量计费。推理按输入/输出Token阶梯计价,训练按数据量和循环次数计费,部署支持按时长或调用量两种模式。
3082 65
|
5月前
|
存储 监控 算法
1688 图片搜索逆向实战:CLIP 多模态融合与特征向量落地方案
本文分享基于CLIP模型与逆向工程实现1688图片搜同款的实战方案。通过抓包分析破解接口签名,结合CLIP多模态特征提取与Faiss向量检索,提升搜索准确率至91%,单次响应低于80ms,日均选品效率提升4倍,全程合规可复现。
|
6月前
|
人工智能 自然语言处理 语音技术
阿里云百炼官网首页登录入口:开通百炼,每个大模型免费100万Tokens
阿里云百炼平台现开放免费领Token福利,开通即享超5000万额度。提供大模型推理、部署及训练服务,涵盖通义千问、万相等多个系列模型。前台介绍平台详情与价格,后台支持API-Key申请及管理操作。
1789 8
|
6月前
|
人工智能 数据可视化 前端开发
AI Ping:精准可靠的大模型服务性能评测平台
AI Ping是清华系团队推出的“大模型服务评测平台”,被誉为“AI界的大众点评”。汇聚230+模型服务,7×24小时监测性能数据,以吞吐量、延迟等硬指标助力开发者科学选型。界面简洁,数据可视化强,支持多模型对比,横向对标国内外主流平台,为AI应用落地提供权威参考。
1581 3
|
5月前
|
存储 人工智能 搜索推荐
拔俗AI大模型教学平台:开启智能教育新时代
在AI与教育深度融合背景下,本文基于阿里云技术构建大模型教学平台,破解个性化不足、反馈滞后等难题。通过“大模型+知识图谱+场景应用”三层架构,实现智能答疑、精准学情分析与个性化学习路径推荐,助力教学质量与效率双提升,推动教育智能化升级。
607 0
|
5月前
|
传感器 人工智能 监控
拔俗多模态跨尺度大数据AI分析平台:让复杂数据“开口说话”的智能引擎
在数字化时代,多模态跨尺度大数据AI分析平台应运而生,打破数据孤岛,融合图像、文本、视频等多源信息,贯通微观与宏观尺度,实现智能诊断、预测与决策,广泛应用于医疗、制造、金融等领域,推动AI从“看懂”到“会思考”的跃迁。
405 0
|
5月前
|
人工智能 运维 NoSQL
拔俗AI大模型知识管理平台:让技术团队的“隐性知识”不再沉睡
技术团队常困于知识“存得住却用不好”。AI大模型知识管理平台如同为团队知识装上“智能大脑”,打通文档、代码、日志等碎片信息,实现智能检索、自动归集、动态更新与安全共享。它让新人快速上手、老手高效排障,把散落的经验变成可复用的智慧。知识不再沉睡,经验永不流失。
182 0