Skip to content
Open
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
9 changes: 6 additions & 3 deletions dspy/clients/base_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,13 @@ def _process_response(self, response):
reasoning_contents = []

for output_item in response.output:
output_item_type = output_item.type
output_item_type = output_item.type if hasattr(output_item, "type") else output_item.get("type")
if output_item_type == "message":
for content_item in output_item.content:
text_outputs.append(content_item.text)
content = output_item.content if hasattr(output_item, "content") else output_item.get("content", [])
for content_item in content:
text_outputs.append(
content_item.text if hasattr(content_item, "text") else content_item.get("text")
)
elif output_item_type == "function_call":
tool_calls.append(output_item.model_dump())
elif output_item_type == "reasoning":
Expand Down