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

[.Net][Bug]: An error occurred: Error code: 500 - {'error': {'message': 'The model produced invalid content. Consider modifying your prompt if you are seeing this error persistently.', 'type': 'model_error', 'param': None, 'code': None}} #3437

Closed
LittleLittleCloud opened this issue Aug 27, 2024 · 0 comments · Fixed by #3481
Assignees

Comments

@LittleLittleCloud
Copy link
Collaborator

LittleLittleCloud commented Aug 27, 2024

Describe the bug

gpt 3.5/4o model raises error code 500 when the message history 1) contains multiple, different tool calls with name field., 2) contains multiple user messages from different users

For example

[
   textMessage("what's weather in Paris", from: "user")
   toolCall(getWeather, Paris, name: assistant)
   toolCallResult("the weather in Paris is sunny")
   textMessage("The weather in Seattle is sunny, now check the tax in Paris", from: "admin"),
   toolCall(calculateTax, Paris, name: assistant)
   toolCallResult("the tax in Paris is xxx")
   textMessage("what's weather in Beijing", from: "user")
   toolCall(getWeather, Beijing, name: assistant)
   toolCallResult("the weather in Beijing is sunny")
   textMessage("The weather in Beijing is sunny, now check the tax in Beijing", from: "admin"),
   toolCall(calculateTax, Beijing, name: assistant)
   toolCallResult("the tax in Beijing is xxx")
   textMessage("what's weather in Seattle", from: "user")
]

// error code: 500

According to https://community.openai.com/t/error-the-model-produced-invalid-content/747511, the model can respond correctly after the name field is removed when the assistant message is a tool call message

For more details, check #3247

python side fix: #3429

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