File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
pydantic_ai_slim/pydantic_ai/agent Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ def _run_span_end_attributes(
684
684
'all_messages_events' : json .dumps (
685
685
[
686
686
InstrumentedModel .event_to_dict (e )
687
- for e in settings .messages_to_otel_events (list ( state .message_history ) )
687
+ for e in settings .messages_to_otel_events (state .message_history )
688
688
]
689
689
)
690
690
}
Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ async def stream_to_final(
493
493
raise exceptions .AgentRunError ('Agent run produced final results' ) # pragma: no cover
494
494
yielded = True
495
495
496
- messages = list ( graph_ctx .state .message_history )
496
+ messages = graph_ctx .state .message_history
497
497
498
498
async def on_complete () -> None :
499
499
"""Called when the stream has completed.
@@ -537,7 +537,7 @@ async def on_complete() -> None:
537
537
# if a tool function raised CallDeferred or ApprovalRequired.
538
538
# In this case there's no response to stream, but we still let the user access the output etc as normal.
539
539
yield StreamedRunResult (
540
- list ( graph_ctx .state .message_history ) ,
540
+ graph_ctx .state .message_history ,
541
541
graph_ctx .deps .new_message_index ,
542
542
run_result = agent_run .result ,
543
543
)
You can’t perform that action at this time.
0 commit comments