fix(responses): enforce spec object on completion bridge (#26327)

Ensure Chat Completions -> Responses bridge always emits object="response" so non-native providers return the same top-level schema as native OpenAI Responses.

Made-with: Cursor
This commit is contained in:
Sameer Kankute 2026-04-24 21:59:06 +05:30 • committed by GitHub
parent e1466be825
commit 4dbea4e957
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -1652,7 +1652,7 @@ class LiteLLMCompletionResponsesConfig:
id=chat_completion_response.id,
created_at=chat_completion_response.created,
model=chat_completion_response.model,
object=chat_completion_response.object,
object="response",
error=getattr(chat_completion_response, "error", None),
incomplete_details=getattr(
chat_completion_response, "incomplete_details", None

View file

@ -369,6 +369,7 @@ class TestLiteLLMCompletionResponsesConfig:
]
assert len(message_items) == 1, "Should have exactly one message item"
assert message_items[0].content[0].text == "Just a regular answer."
assert responses_api_response.object == "response"
def test_transform_chat_completion_response_multiple_choices_with_reasoning(self):
"""Test that only reasoning from first choice is included when multiple choices exist"""