Unable to submit request because function call `default_api:get_weather` in the ...
错误信息
Unable to submit request because function call `default_api:get_weather` in the 2. content block is missing a `thought_signature`. Learn more: https://***.com/***/***/***/***
AI 解决方案
代码报错分析
1. 错误翻译
原文:Unable to submit request because function call `default_api:get_weather` in the 2. content block is missing a `thought_signature`
译文:无法提交请求,因为第2个内容块中的函数调用 `default_api:get_weather` 缺少 `thought_signature`
2. 原因分析
thought_signature参数default_api:get_weather函数调用3. 解决方案
{
"function": "default_api:get_weather",
"thought_signature": "自定义的思维签名标识",
"parameters": {
"location": "城市名称",
"unit": "温度单位"
}
}
# Python示例修复
def call_weather_api():
api_request = {
"function": "default_api:get_weather",
"thought_signature": "weather_query_2024", # 添加thought_signature
"parameters": {
"location": "Beijing",
"unit": "celsius"
}
}
return api_request
4. ️ 预防措施
thought_signature参数建议:将thought_signature作为模板变量,在代码模板中预先定义,避免遗漏。