Skip to content

Commit 72f9a66

Browse files
committed
review
1 parent 99d3d89 commit 72f9a66

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pydantic_ai_slim/pydantic_ai/agent/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def _run_span_end_attributes(
684684
'all_messages_events': json.dumps(
685685
[
686686
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)
688688
]
689689
)
690690
}

pydantic_ai_slim/pydantic_ai/agent/abstract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ async def stream_to_final(
493493
raise exceptions.AgentRunError('Agent run produced final results') # pragma: no cover
494494
yielded = True
495495

496-
messages = list(graph_ctx.state.message_history)
496+
messages = graph_ctx.state.message_history
497497

498498
async def on_complete() -> None:
499499
"""Called when the stream has completed.
@@ -537,7 +537,7 @@ async def on_complete() -> None:
537537
# if a tool function raised CallDeferred or ApprovalRequired.
538538
# In this case there's no response to stream, but we still let the user access the output etc as normal.
539539
yield StreamedRunResult(
540-
list(graph_ctx.state.message_history),
540+
graph_ctx.state.message_history,
541541
graph_ctx.deps.new_message_index,
542542
run_result=agent_run.result,
543543
)

0 commit comments

Comments
 (0)