", "error": { "type": "invalid_request_error", "message": "tools.3.custom.input_...

2025年11月26日 09:49 状态: processing

🚨 错误信息

{ "type": "error", "error": { "type": "invalid_request_error", "message": "tools.3.custom.input_examples: Extra inputs are not permitted" }, "request_id": "req_011CVVfGtNYFrPQpXFdT9w6G" }

🤖 AI解决方案

报错分析

1. 错误翻译

原文:tools.3.custom.input_examples: Extra inputs are not permitted
译文:tools.3.custom.input_examples:不允许额外的输入参数

2. 原因分析

这是一个API请求参数验证错误,具体原因:
  • 在请求的tools数组中第4个工具对象的custom.input_examples字段
  • 包含了API规范不允许的额外输入参数或字段
  • 很可能传入了无效的、多余的或格式不正确的内容
  • 3. 解决方案

    {
        "type": "function",
        "function": {
            "name": "your_function_name",
            "description": "Function description",
            "parameters": {
                "type": "object",
                "properties": {
                    // 正确的参数定义
                }
            }
        }
    }

    修复步骤:

  • 检查tools数组中第4个元素的custom.input_examples结构

  • 移除所有不符合API规范的额外字段

  • 确保input_examples遵循正确的格式要求

  • 仅保留必要的参数
  • 4. ️ 预防措施

  • API文档验证:在调用前仔细阅读API文档中的参数规范要求
  • 参数校验工具:使用JSON Schema验证工具检查请求参数结构的正确性
  • 推荐工具:

  • JSON Schema Validator

  • API文档测试工具(如Postman、Swagger)

需要更多具体的参数结构信息?请提供相关的API文档或完整的请求示例。