Skip to content

Import error with openai package 1.99.0Β #1378

@midfield-dev

Description

@midfield-dev

Describe the bug

Using the examples/basic/hello_world.py example or any example in the repo results into this error:

Error getting response: cannot import name 'ResponseReasoningSummaryDoneEvent' from 'openai.types.responses' (/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/types/responses/__init__.py). (request_id: None)
Traceback (most recent call last):
  File "/Users/pcuser/agent-exp/agent-hello.py", line 31, in <module>
    asyncio.run(main())
  File "/usr/local/Cellar/[email protected]/3.11.12/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.12/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.12/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agent-hello.py", line 14, in main
    result = await Runner.run(
             ^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/agents/run.py", line 206, in run
    return await runner.run(
           ^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/agents/run.py", line 412, in run
    input_guardrail_results, turn_result = await asyncio.gather(
                                           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/agents/run.py", line 956, in _run_single_turn
    new_response = await cls._get_new_response(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/agents/run.py", line 1168, in _get_new_response
    new_response = await model.get_response(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/agents/models/openai_responses.py", line 83, in get_response
    response = await self._fetch_response(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/agents/models/openai_responses.py", line 267, in _fetch_response
    return await self._client.responses.create(
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.12/Frameworks/Python.framework/Versions/3.11/lib/python3.11/functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/_client.py", line 572, in responses
    from .resources.responses import AsyncResponses
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/resources/responses/__init__.py", line 3, in <module>
    from .responses import (
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/resources/responses/responses.py", line 40, in <module>
    from ...lib.streaming.responses._responses import ResponseStreamManager, AsyncResponseStreamManager
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/lib/streaming/responses/__init__.py", line 1, in <module>
    from ._events import (
  File "/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/lib/streaming/responses/_events.py", line 8, in <module>
    from ....types.responses import (
ImportError: cannot import name 'ResponseReasoningSummaryDoneEvent' from 'openai.types.responses' (/Users/pcuser/agent-exp/agentenv/lib/python3.11/site-packages/openai/types/responses/__init__.py)

Debug information

  • Agents SDK version: 0.2.4
  • Python version - 3.11
  • Openai: 1.99.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions