Skip to content

Latest openai release (1.99.2) breaks LitellmModel. #1395

@daavoo

Description

@daavoo

Describe the bug

Importing LitellModel along with the latest openai release breaks due to an outdated import.

Debug information

  • Agents SDK version: 0.2.4
  • Python version (e.g. Python 3.10)

Repro steps

pip install --upgrade openai "openai-agents[litellm]"
python -c "from agents.extensions.models.litellm_model import LitellmModel"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from agents.extensions.models.litellm_model import LitellmModel
  File "/home/daavoo/test/.venv/lib/python3.13/site-packages/agents/extensions/models/litellm_model.py", line 27, in <module>
    from openai.types.chat.chat_completion_message_tool_call import Function
ImportError: cannot import name 'Function' from 'openai.types.chat.chat_completion_message_tool_call' (/home/daavoo/test/.venv/lib/python3.13/site-packages/openai/types/chat/chat_completion_message_tool_call.py)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions