-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error when using model 'gpt-4o' with multiple tools in chat-with-tools example #1623
Comments
Fixed: |
@rossanodr how did you end up fixing this? |
sorry for the late response
|
Description
Description:
The error occurs when following the example: link but using the model const model = 'gpt-4o';. When making a call with 2 or more tools, the following error happens:
Error calling experimental_onToolCall: BadRequestError: 400 An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_vg71gjwxV7clGEZU9t664SrO
Code example
const response = await openai.chat.completions.create({
model: 'gpt-4o',
stream: true,
messages,
tools,
tool_choice: "auto",
});
Additional context
Works fine if the
const response = await openai.chat.completions.create({ model: 'gpt-3.5-turbo-0613, stream: true, messages, tools, tool_choice: 'auto', });
and the
return openai.chat.completions.create({ messages: [...messages, ...newMessages], model: 'gpt-4o', stream: true, tools, tool_choice: 'auto', });
The text was updated successfully, but these errors were encountered: