Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion litellm/llms/azure/responses/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _handle_reasoning_item(self, item: Dict[str, Any]) -> Dict[str, Any]:
# Ensure required fields are present for ResponseReasoningItem
item_data = dict(item)
if "id" not in item_data:
item_data["id"] = f"reasoning_{hash(str(item_data))}"
item_data["id"] = f"rs_{hash(str(item_data))}"
if "summary" not in item_data:
item_data["summary"] = (
item_data.get("reasoning_content", "")[:100] + "..."
Expand Down
2 changes: 1 addition & 1 deletion litellm/llms/openai/responses/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _handle_reasoning_item(self, item: Dict[str, Any]) -> Dict[str, Any]:
# Ensure required fields are present for ResponseReasoningItem
item_data = dict(item)
if "id" not in item_data:
item_data["id"] = f"reasoning_{hash(str(item_data))}"
item_data["id"] = f"rs_{hash(str(item_data))}"
if "summary" not in item_data:
item_data["summary"] = (
item_data.get("reasoning_content", "")[:100] + "..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _transform_chat_completion_chunk_to_response_api_chunk(

return ReasoningSummaryTextDeltaEvent(
type=ResponsesAPIStreamEvents.REASONING_SUMMARY_TEXT_DELTA,
item_id=f"{chunk.id}_reasoning",
item_id=f"rs_{hash(str(reasoning_content))}",
output_index=0,
delta=reasoning_content,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def _extract_reasoning_output_items(
return [
GenericResponseOutputItem(
type="reasoning",
id=f"{chat_completion_response.id}_reasoning",
id=f"rs_{hash(str(message.reasoning_content))}",
status=choice.finish_reason,
role="assistant",
content=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_transform_chat_completion_response_with_reasoning_content(self):
assert len(reasoning_items) == 1, "Should have exactly one reasoning item"

reasoning_item = reasoning_items[0]
assert reasoning_item.id == "test-response-id_reasoning"
assert reasoning_item.id.startswith("rs_"), f"Expected ID to start with 'rs_', got: {reasoning_item.id}"
assert reasoning_item.status == "stop"
assert reasoning_item.role == "assistant"
assert len(reasoning_item.content) == 1
Expand Down
Loading