---
type: email
from: Hareesh <notifications@github.com>
subject: [openai/openai-agents-python] fix: handle omit type in

 `_remove_not_given()` for litellm model (PR #1893)
received: 2026-03-06 08:03:25
date_header: Tue, 14 Oct 2025 05:04:02 -0700
priority: normal
status: awaiting_approval
uid: 32522
---

## Email Content

**From:** Hareesh <notifications@github.com>
**Subject:** [openai/openai-agents-python] fix: handle omit type in

 `_remove_not_given()` for litellm model (PR #1893)
**Date:** Tue, 14 Oct 2025 05:04:02 -0700

### Body (preview)

When running the code example to use agents sdk with LiteLLM: https://openai.github.io/openai-agents-python/models/litellm/



I get the following error:

```

File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/src/agents/extensions/models/litellm_model.py&quot;, line 99, in get_response

    response = await self._fetch_response(

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/src/agents/extensions/models/litellm_model.py&quot;, line 345, in _fetch_response

    ret = await litellm.acompletion(

          ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/.venv/lib/python3.11/site-packages/litellm/utils.py&quot;, line 1586, in wrapper_async

    raise e

  File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/.venv/lib/python3.11/site-packages/litellm/utils.py&quot;, line 1437, in wrapper_async

    result = await original_function(*args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/.venv/lib/python3.11/site-packages/litellm/main.py&quot;, line 563, in acompletion

    raise exception_type(

          ^^^^^^^^^^^^^^^

  File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/.venv/lib/python3.11/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py&quot;, line 2306, in exception_type

    raise e  # it&#39;s already mapped

    ^^^^^^^

  File &quot;/Users/hareeshbahuleyan/Desktop/mzai_github/openai-agents-python/.venv/lib/python3.11/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py&quot;, line 539, in exception_type

    raise APIConnectionError(

litellm.exceptions.APIConnectionError: litellm.APIConnectionError: APIConnectionError: OpenAIException - Invalid tool choice, tool_choice=&lt;openai.Omit object at 0x104a97c90&gt;. Got=&lt;class &#3

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
