Skip to content

Gemini does not work with agents sdk #226

Closed

Description

@kmariunas

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

Activity

  1. added
    bug
    on Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions