From 2686156c379ebe2ce90ddeb07168e2daf5ba6e0a Mon Sep 17 00:00:00 2001 From: ashengstd Date: Fri, 10 Oct 2025 08:46:10 +0800 Subject: [PATCH] temporarily relax ResponsesAPIResponse parsing to support custom backends (#15362) - Replace `ResponsesAPIResponse(**raw_response_json)` with `ResponsesAPIResponse.model_construct(**raw_response_json)` to bypass strict Pydantic validation. - Allows Response API to work with self-hosted or non-strict models (e.g., vLLM) without raising literal/type errors. - This is a temporary, low-risk relaxation to improve compatibility with more backend implementations. --- litellm/llms/openai/responses/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/openai/responses/transformation.py b/litellm/llms/openai/responses/transformation.py index e5e89cd8bc6..4c82a35c119 100644 --- a/litellm/llms/openai/responses/transformation.py +++ b/litellm/llms/openai/responses/transformation.py @@ -169,7 +169,7 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig): raise OpenAIError( message=raw_response.text, status_code=raw_response.status_code ) - return ResponsesAPIResponse(**raw_response_json) + return ResponsesAPIResponse.model_construct(**raw_response_json) def validate_environment( self, headers: dict, model: str, litellm_params: Optional[GenericLiteLLMParams]