Function call is missing a thought_signature in functionCall parts. This is requ...

2025年12月15日 21:13 状态: processing

🚨 错误信息

Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:builtin_knowledge_search` , position 2. Please refer to https://***.dev/***/***/*** for more details. (request id: 202512152102557077188356769560) (request id: 2025121521025512340803fdJskQpd)

🤖 AI解决方案

报错分析报告

1. 错误翻译

原文:Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance.
译文:函数调用缺少 thought_signature 参数。这是工具正常工作的必要条件,缺少此参数可能导致模型性能下降。

2. 原因分析

根本原因:在使用函数调用功能时,请求参数中缺少必需的 thought_signature 字段。

具体位置

  • 函数调用:default_api:builtin_knowledge_search

  • 位置:请求中的第2个函数调用部分

  • 涉及API调用或工具集成场景
  • 问题说明:DMXAPI平台要求函数调用必须包含 thought_signature 参数,这是模型在处理工具调用时的元数据标识,用于确保函数调用的完整性和模型推理的连贯性。

    3. 解决方案

    方法一:修复请求参数

    {
      "function_calls": [
        {
          "name": "function_name_1",
          "thought_signature": "对当前函数调用的推理思考签名",
          "arguments": {...}
        },
        {
          "name": "default_api:builtin_knowledge_search",
          "thought_signature": "知识搜索函数的推理签名",
          "arguments": {...}
        }
      ]
    }

    方法二:使用SDK示例

    // 使用DMXAPI SDK的正确调用方式
    const response = await dmxapi.functionCall({
      name: 'default_api:builtin_knowledge_search',
      thought_signature: '用户请求需要搜索相关信息来回答',
      arguments: {
        query: '搜索关键词',
        limit: 5
      }
    });

    4. ️ 预防措施

    最佳实践

  • 参数校验:在发起函数调用前,始终检查是否包含 thought_signature 字段
  • 签名生成:为每个函数调用生成有意义的思考签名,描述调用该函数的理由或上下文
  • ️ 工具推荐

  • 使用DMXAPI官方SDK,自动处理参数校验
  • 在开发环境中启用严格模式,捕获缺少必需参数的早期警告
  • 参考官方文档确保API调用格式正确

---
下次遇到类似问题:检查函数调用参数是否完整,特别是平台要求的特殊字段。建议保存错误链接供详细查阅:https://.dev///