Skip to content
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

OpenAI API error: Messages with role 'tool' must be a response to a preceding message with 'tool_calls' #744

Open
scyoyo opened this issue Mar 16, 2025 · 0 comments

Comments

@scyoyo
Copy link

scyoyo commented Mar 16, 2025

2025-03-16 09:53:42.037 | INFO | app.agent.base:run:137 - Executing step 17/20
2025-03-16 09:53:42.844 | ERROR | app.llm:ask_tool:426 - OpenAI API error: Error code: 400 - {'error': {'message': "Messages with role 'tool' must be a response to a preceding message with 'tool_calls'", 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}
2025-03-16 09:53:42.844 | ERROR | app.llm:ask_tool:432 - API error: Error code: 400 - {'error': {'message': "Messages with role 'tool' must be a response to a preceding message with 'tool_calls'", 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}

Got this error when I run a request. Not sure if it is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant