400 {"error":{"type":"400","message":"Provider API error: Invalid JSON payload r...

2026年05月01日 20:47 processing

错误信息

API Error: 400 {"error":{"type":"400","message":"Provider API error: Invalid JSON payload received. Unknown name \"propertyNames\" at 'tools[0].function_declarations[1].***.properties[0].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"propertyNames\" at 'tools[0].function_declarations[1].***.properties[1].value': Cannot find field. (request id: 202605012046124605328663N1v6HRM)"},"type":"error"} You can restart the conversation from an earlier message.

AI 解决方案

报错分析报告

1.错误翻译


原文:Invalid JSON payload received. Unknown name "propertyNames" at 'tools[0].function_declarations[1].***.properties[0].value': Cannot find field.
译文:收到无效的JSON负载。在'tools[0].function_declarations[1].***.properties[0].value'处发现未知名称"propertyNames":无法找到该字段。

原文:Invalid JSON payload received. Unknown name "propertyNames" at 'tools[0].function_declarations[1].***.properties[1].value': Cannot find field.
译文:收到无效的JSON负载。在'tools[0].function_declarations[1].***.properties[1].value'处发现未知名称"propertyNames":无法找到该字段。

2. 原因分析


  • 根本原因:提交的JSON负载包含API无法识别的字段propertyNames

  • 具体位置tools[0].function_declarations[1]对应的.properties[0].valueproperties[1].value路径下。
  • 3. 解决方案


    移除JSON中未知的propertyNames字段,确保负载符合API schema:
    {
      "tools": [
        {
          "function_declarations": [
            {},
            {
              "***": {
                "properties": [
                  { "value": {} },  // 移除propertyNames
                  { "value": {} }   // 移除propertyNames
                ]
              }
            }
          ]
        }
      ]
    }
    

    4. 预防措施


  • 提交前用JSON Schema验证工具*(如[AJV](https://ajv.js.org/))校验负载;

  • 严格对照API文档确认允许字段,避免臆造参数。
  • 推荐工具:Postman(内置Schema验证)、VS Code插件「JSON Schema Validator」。