-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The agent reports an error using the gpt-4o-mini model #12881
Comments
I found a similar unsolved discussion titled Bug of Use Claude, which might be related to the issue you're experiencing [1]. The error you're encountering, "Invalid value for 'content': expected a string, got null," typically indicates that the 'content' field in the 'messages' object is not being populated correctly. This can happen if the context retrieval process fails to provide valid content, resulting in a null value being passed to the OpenAI API. To address this issue, you might want to check the following:
These steps should help you identify and resolve the issue with the 'content' field in the 'messages' object. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Hi @yunfeng13. Thank you for the report. Could you please provide your logs in the |
That means some |
Do you mean that the api returns a null value? Will returning null cause llm to report an error? |
Yes, the path of the wrong result is |
Thank you very much. Then I will try another apikey. |
Self Checks
Dify version
0.15.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
error detail:[openai] Bad Request Error, Error code: 400 - {'error': {'message': "Invalid value for 'content': expected a string, got null. (request id: 202501202012127715196675TbPifJ3) (request id: 20250120201212658215175TCApZ8tE) (request id: 2025012020121243955128724364135) (request id: 2025012020121234417090004257917) (request id: 20250120201212335003074lycgz9cp)", 'type': 'invalid_request_error', 'param': 'messages.[4].content', 'code': None}}
I found that once the agent adds context and retrieves it, it will report an error if asked again.
✔️ Expected Behavior
I hope to know the reason. If the context is not hit, it will not report an error. Once it hits, it will report an error.
❌ Actual Behavior
error detail:[openai] Bad Request Error, Error code: 400 - {'error': {'message': "Invalid value for 'content': expected a string, got null. (request id: 202501202012127715196675TbPifJ3) (request id: 20250120201212658215175TCApZ8tE) (request id: 2025012020121243955128724364135) (request id: 2025012020121234417090004257917) (request id: 20250120201212335003074lycgz9cp)", 'type': 'invalid_request_error', 'param': 'messages.[4].content', 'code': None}}
The text was updated successfully, but these errors were encountered: