mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
Merge fce6f976b0 into aeede53112
This commit is contained in:
commit
8d939efca1
2 changed files with 13 additions and 2 deletions
|
|
@ -3642,9 +3642,10 @@ class LiteLLMCompletionResponsesConfig:
|
|||
id=mint_reasoning_item_id(),
|
||||
status=LiteLLMCompletionResponsesConfig._responses_status_for_choice(choice),
|
||||
role="assistant",
|
||||
summary=[],
|
||||
content=[
|
||||
OutputText(
|
||||
type="output_text",
|
||||
type="reasoning_text",
|
||||
text=text,
|
||||
annotations=[],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ class TestLiteLLMCompletionResponsesConfig:
|
|||
assert reasoning_item.status == "completed"
|
||||
assert reasoning_item.role == "assistant"
|
||||
assert len(reasoning_item.content) == 1
|
||||
assert reasoning_item.content[0].type == "output_text"
|
||||
assert reasoning_item.content[0].type == "reasoning_text"
|
||||
assert "step by step" in reasoning_item.content[0].text
|
||||
assert "42" in reasoning_item.content[0].text
|
||||
|
||||
|
|
@ -5618,6 +5618,16 @@ class TestBridgedOutputItemIdPrefixes:
|
|||
assert not suffix.lstrip("-").isdigit()
|
||||
assert not suffix.startswith("-")
|
||||
|
||||
def test_reasoning_item_is_a_responses_reasoning_item(self):
|
||||
"""A client that validates output items (the OpenAI Agents SDK restoring a paused run)
|
||||
rejected the bridged item: it had no ``summary`` and typed its text ``output_text``."""
|
||||
from openai.types.responses import ResponseReasoningItem
|
||||
|
||||
item = ResponseReasoningItem.model_validate(self._reasoning_items()[0].model_dump())
|
||||
|
||||
assert item.summary == []
|
||||
assert [(part.type, part.text) for part in item.content or []] == [("reasoning_text", "thinking about fruit")]
|
||||
|
||||
|
||||
class TestStreamingSnapshotItemIds:
|
||||
"""The response.completed snapshot must reuse the streamed item ID (issue #27333).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue