mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
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:
parent
e1466be825
commit
4dbea4e957
2 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue