Problem using tools: invalid sequence #401
Answered
by
StephenHodgson
RESEARCHEKASA
asked this question in
Q&A
-
When adding a Role.Tool message. I always get: Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls' The Role.Tool message has the result from the tool, that is correctly called... Where is my mistake? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
StephenHodgson
Jan 16, 2025
Replies: 1 comment 1 reply
-
You must submit tool call output results before adding your tool message to the message list. Check the unit tests for example OpenAI-DotNet/OpenAI-DotNet-Tests/TestFixture_04_Chat.cs Lines 340 to 350 in 29fdae0 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RESEARCHEKASA
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You must submit tool call output results before adding your tool message to the message list.
Check the unit tests for example
OpenAI-DotNet/OpenAI-DotNet-Tests/TestFixture_04_Chat.cs
Lines 340 to 350 in 29fdae0