-
Notifications
You must be signed in to change notification settings - Fork 1.3k
400 BadRequestError with Gemini provider – Invalid JSON payload ("metadata" and "store" fields) #443
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
Comments
Yes, I'm also facing the same bug. OpenAI has updated its library, which is causing some errors when providing Gemini Client. I've worked with version 0.0.4, and in that, it was working fine. But when I started a new project with the latest version, it is causing issues when providing with Gemini Provider. |
Yes, facing the same issue of json payload....Try different things but can't debug it, Maybe, something new Package/Library is added to new version. |
I'm having the same BadRequestError. How do I resolve it? |
I tested older versions (0.0.7, 0.0.6, 0.0.5, and 0.0.4) and they work fine without the metadata and store payload errors. So it seems that version 0.0.8 is introducing this issue, possibly by including unsupported fields like metadata and store in the request payload, which are not supported by the Gemini API via the OpenAI-compatible endpoint (https://generativelanguage.googleapis.com/v1beta/openai/). |
Yessir thanks a lot! I just tried the 0.0.4 version and it worked fine! Hope they resolve this issue in the latest versions as well |
same issue |
+1 on this |
same issue with 0.0.8, breaking change. #431 |
same issue |
Sorry about that, fixing now. |
Summary: See #443. Causes issues with Gemini. Test Plan: Tests.
Summary: See #443. Causes issues with Gemini. Test Plan: Tests.
Summary: See #443. Causes issues with Gemini. Test Plan: Tests.
For metadata property issue. I have added two review comments in openai_chatcompletions.py and openai_responses.py. In short the changes will be: current: change to: |
Summary: See #443. Causes issues with Gemini. Test Plan: Tests. Also tested with Gemini to ensure it works.
v0.0.9 should be out in a few mins. Let me know if you have any issues with it. |
Closing. Please create a new issue for any follow ups! |
Summary: See openai#443. Causes issues with Gemini. Test Plan: Tests. Also tested with Gemini to ensure it works.
Please read this first
Describe the question
I'm using the OpenAI Agents SDK with a custom model provider (Google Gemini via
https://generativelanguage.googleapis.com/v1beta/openai/
) and encountering aBadRequestError
.The Gemini API rejects the request with this error:
BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'Invalid JSON payload received. Unknown name "metadata": Cannot find field.\nInvalid JSON payload received. Unknown name "store": Cannot find field.'}}]
It appears that the Agents SDK is sending
metadata
andstore
fields automatically, but the Gemini API doesn't support these.Debug information
v0.0.3
3.11
Google Gemini (Flash 1.5)/(Flash 2.0)
chat.completions.create
Repro steps
Here’s a minimal script to reproduce the issue:
The text was updated successfully, but these errors were encountered: