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]

Merge branch 'main' into litellm_oss_staging_02_07_20262

Sameer Kankuted8f114e3632a
diff --cc litellm/llms/openai/responses/transformation.py
index 9fe485b4f3d,5c870711062..3e089682097
--- a/litellm/llms/openai/responses/transformation.py
+++ b/litellm/llms/openai/responses/transformation.py
@@@ -254,20 -248,8 +248,18 @@@ class OpenAIResponsesAPIConfig(BaseResp
parsed_chunk["error"] = dict(error_obj)
parsed_chunk["error"]["code"] = "unknown_error"
except Exception:
- # If anything unexpected happens here, fall back to attempting
- # instantiation and let higher-level handlers manage errors.
verbose_logger.debug("Failed to coalesce error.code in parsed_chunk")
- return event_pydantic_model(**parsed_chunk)
+
+ try:
+ return event_pydantic_model(**parsed_chunk)
+ except ValidationError:
+ verbose_logger.debug(
+ "Pydantic validation failed for %s with chunk %s, "
+ "falling back to model_construct",
+ event_pydantic_model.__name__,
+ parsed_chunk,
+ )
+ return event_pydantic_model.model_construct(**parsed_chunk)
@staticmethod
def get_event_model_class(event_type: str) -> Any: