Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: don't fail request if unmapped item in responses list

Krrish Dholakiaf4131b023ee5
diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.py
index 43fb64b69ea..42f5c2b6a50 100644
--- a/litellm/completion_extras/litellm_responses_transformation/transformation.py
+++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py
@@ -277,13 +277,8 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
Choices(message=msg, finish_reason="tool_calls", index=index)
)
index += 1
- elif isinstance(item, GenericResponseOutputItem):
- raise ValueError("GenericResponseOutputItem not supported")
- elif isinstance(item, OutputFunctionToolCall):
- # function/tool calls pass through as-is
- raise ValueError("Function calling not supported yet.")
else:
- raise ValueError(f"Unknown item type: {item}")
+ pass # don't fail request if item in list is not supported
if len(choices) == 0:
if (
@@ -293,6 +288,10 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
raise ValueError(
f"{model} unable to complete request: {raw_response.incomplete_details.reason}"
)
+ else:
+ raise ValueError(
+ f"Unknown items in responses API response: {raw_response.output}"
+ )
setattr(model_response, "choices", choices)
diff --git a/tests/llm_translation/test_openai.py b/tests/llm_translation/test_openai.py
index e8c5adacc1a..1145d8c3469 100644
--- a/tests/llm_translation/test_openai.py
+++ b/tests/llm_translation/test_openai.py
@@ -552,7 +552,7 @@ def test_openai_deepresearch_model_bridge():
litellm._turn_on_debug()
response = litellm.completion(
model="o3-deep-research-2025-06-26",
- messages=[{"role": "user", "content": "What is the capital of France?"}],
+ messages=[{"role": "user", "content": "Hey, how's it going?"}],
tools=[
{"type": "web_search_preview"},
{"type": "code_interpreter", "container": {"type": "auto"}},