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 pull request #16844 from Chesars/fix/response-format-to-text-format-bridge-conversion

Sameer Kankutecd65a84abdef
diff --cc litellm/completion_extras/litellm_responses_transformation/transformation.py
index e37be860b52,a6dbd5d0dcd..07d9de5a016
--- a/litellm/completion_extras/litellm_responses_transformation/transformation.py
+++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py
@@@ -234,11 -196,16 +234,16 @@@ class LiteLLMResponsesTransformationHan
cast(List[Dict[str, Any]], value)
)
)
+ elif key == "response_format":
+ # Convert response_format to text.format
+ text_format = self._transform_response_format_to_text_format(value)
+ if text_format:
+ responses_api_request["text"] = text_format # type: ignore
elif key in ResponsesAPIOptionalRequestParams.__annotations__.keys():
responses_api_request[key] = value # type: ignore
- elif key in ("metadata"):
+ elif key == "metadata":
responses_api_request["metadata"] = value
- elif key in ("previous_response_id"):
+ elif key == "previous_response_id":
responses_api_request["previous_response_id"] = value
elif key == "reasoning_effort":
responses_api_request["reasoning"] = self._map_reasoning_effort(value)