Skip to content

Commit 3f688bb

Browse files
committed
fix
1 parent 08844f0 commit 3f688bb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/agents/extensions/models/litellm_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,18 @@ def convert_message_to_openai(
364364
provider_specific_fields.get("refusal", None) if provider_specific_fields else None
365365
)
366366

367+
reasoning_content = ""
368+
if hasattr(message, "reasoning_content") and message.reasoning_content:
369+
reasoning_content = message.reasoning_content
370+
367371
return ChatCompletionMessage(
368372
content=message.content,
369373
refusal=refusal,
370374
role="assistant",
371375
annotations=cls.convert_annotations_to_openai(message),
372376
audio=message.get("audio", None), # litellm deletes audio if not present
373377
tool_calls=tool_calls,
374-
reasoning_content=message.reasoning_content,
378+
reasoning_content=reasoning_content,
375379
)
376380

377381
@classmethod

src/agents/models/chatcmpl_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def maybe_response_output_message(cls, item: Any) -> ResponseOutputMessageParam
207207
):
208208
return cast(ResponseOutputMessageParam, item)
209209
return None
210-
210+
211211
@classmethod
212212
def maybe_reasoning_message(cls, item: Any) -> ResponseReasoningItemParam | None:
213213
if isinstance(item, dict) and item.get("type") == "reasoning":

0 commit comments

Comments
 (0)