/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解决方案
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'}}
**错误翻译:**错误码: 400 - {'error': {'message': "函数 'self_intent_recognition_0' 的 schema 无效: None 类型不是 'array'。 (请求 ID: 20250903110948261917640BBDOPt2p)", 'type': 'openai_error', 'param': '', 'code': 'invalid_function_parameters'}}
**原因分析:**
函数 `self_intent_recognition_0` 的 schema 定义中,某个参数期望接收一个数组(`array`)类型,但实际传入的值为 `None`。
**解决方案:**
检查调用 `self_intent_recognition_0` 函数的代码,确保传递给该函数的参数符合 schema 定义。特别是,如果某个参数期望是数组类型,请确保传入的是一个非空的数组,而不是 `None`。
例如,如果 schema 定义了一个名为 `items` 的数组参数,而你的代码是这样调用的:pythoncall_function(function_name='self_intent_recognition_0', arguments={'items': None})
你应该修改为:pythoncall_function(function_name='self_intent_recognition_0', arguments={'items': []}) # 或者传入一个包含元素的数组
```
预防措施:
- 在调用函数前,对传入的参数进行类型和非空校验,确保其符合函数的 schema 要求。
- 在函数定义或 schema 定义时,明确指定参数的默认值,或者将其设置为可选,以避免在未提供时出现
None导致的错误。