File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
pydantic_ai_slim/pydantic_ai Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,9 @@ def _messages_from_ag_ui(messages: list[Message]) -> list[ModelMessage]:
486
486
if isinstance (msg , UserMessage ):
487
487
result .append (ModelRequest (parts = [UserPromptPart (content = msg .content )]))
488
488
elif isinstance (msg , AssistantMessage ):
489
+ if msg .content :
490
+ result .append (ModelResponse (parts = [TextPart (content = msg .content )]))
491
+
489
492
if msg .tool_calls :
490
493
for tool_call in msg .tool_calls :
491
494
tool_calls [tool_call .id ] = tool_call .function .name
@@ -502,9 +505,6 @@ def _messages_from_ag_ui(messages: list[Message]) -> list[ModelMessage]:
502
505
]
503
506
)
504
507
)
505
-
506
- if msg .content :
507
- result .append (ModelResponse (parts = [TextPart (content = msg .content )]))
508
508
elif isinstance (msg , SystemMessage ):
509
509
result .append (ModelRequest (parts = [SystemPromptPart (content = msg .content )]))
510
510
elif isinstance (msg , ToolMessage ):
You can’t perform that action at this time.
0 commit comments