/MainProcess] 22208184909825/agent-e80a0 agent invoke chat to retry again llm er...
错误信息
[2025-09-03 11:10:25,969: ERROR/MainProcess] 22208184909825/agent-e80a0 agent invoke chat to retry again llm error: Error code: 400 - {'error': {'message': "Invalid schema for function 'self_intent_recognition_0': None is not of type 'array'. (request id: 20250903110948261917640BBDOPt2p)", 'type': 'openai_error', 'param': '', 'code': 'invalid_function_parameters'}}
AI 解决方案
报错分析报告
1.错误翻译
原文:Invalid schema for function 'self_intent_recognition_0': None is not of type 'array'. (request id: 20250903110948261917640BBDOPt2p)
译文:函数'self_intent_recognition_0'的 schema 无效:None 不是 'array' 类型。(请求ID: 20250903110948261917640BBDOPt2p)
2.原因分析
self_intent_recognition_0的参数Schema定义中,某字段预期为array类型,但实际传入了None。 3. 解决方案
修正函数
self_intent_recognition_0的Schema,确保目标字段为array类型(禁止None,或设默认值): // 修复后的Function Schema示例(以OpenAI Function Calling格式为例)
{
"name": "self_intent_recognition_0",
"description": "意图识别函数",
"parameters": {
"type": "object",
"properties": {
// 假设问题字段是"intent_keywords",原定义允许None,现强制为array
"intent_keywords": {
"type": "array",
"items": { "type": "string" },
"description": "意图关键词列表",
"default": [] // 可选:设默认空数组避免None
}
},
"required": ["intent_keywords"]
}
}
4.️ 预防措施
isinstance(param, list)),禁止None传入array字段。 ---
若需进一步分析,请补充函数self_intent_recognition_0的完整Schema或调用代码。