diff --git a/litellm/llms/chatgpt/responses/transformation.py b/litellm/llms/chatgpt/responses/transformation.py index c5f67b78654..2fbbffde1ef 100644 --- a/litellm/llms/chatgpt/responses/transformation.py +++ b/litellm/llms/chatgpt/responses/transformation.py @@ -66,13 +66,14 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): litellm_params: GenericLiteLLMParams, headers: dict, ) -> dict: - # The Responses API accepts a string or a list, but this backend - # rejects a string with {"detail": "Input must be a list"}. - if isinstance(input, str): - input = [{"role": "user", "content": input}] # mutable-ok: the wire payload this backend requires + coerced_input: Final = ( + [{"role": "user", "content": input}] # mutable-ok: the wire shape this backend accepts + if isinstance(input, str) + else input + ) request: Final = super().transform_responses_api_request( model, - input, + coerced_input, response_api_optional_request_params, litellm_params, headers, @@ -103,8 +104,6 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): "reasoning", "previous_response_id", "truncation", - # The chat-to-responses bridge translates response_format into - # "text"; dropping it here discards strict schemas silently. "text", }