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

Gemini does not work with agents sdk #226

Closed
kmariunas opened this issue Mar 18, 2025 · 0 comments
Closed

Gemini does not work with agents sdk #226

kmariunas opened this issue Mar 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kmariunas
Copy link

Describe the question

Trying to run gemini model for a triage agent, but i get this error, because instead of an actual id for an event, it uses _fake_id
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'input[1].id': '__fake_id__'. Expected an ID that begins with 'msg'.", 'type': 'invalid_request_error', 'param': 'input[1].id', 'code': 'invalid_value'}}

Debug information

  • Agents SDK version: (e.g. v0.0.4)
  • Python version (e.g. Python 3.12.8)

Repro steps

gemini = AsyncOpenAI(
        api_key="KEY",
        base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
    )
agent = Agent(
            name=self.agent_name,
            instructions=f"{RECOMMENDED_PROMPT_PREFIX}}",
            handoffs=handoffs,
            model=OpenAIChatCompletionsModel(model="gemini-2.0-flash-001", openai_client=gemini)
)
Runner.run_streamed(agent, "Hi!")

Expected behavior

Runs normally

@kmariunas kmariunas added the bug Something isn't working label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant