-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
When I use agent.run, it loops through the tools until completion, however run_stream's implementation is that it just returns after one iter. Wouldn't it make more sense for the default behavior to be do the same thing as agent.run does, and loop through tool executions until completion?
Example Code
Instead of including my own code, I think I can see the problematic area of logic in the run_stream implementation:
final_result = await stream_to_final(streamed_response)
if final_result is not None:
yield StreamedRunResult(...)
break # ← Exits early, preventing tool processing steps
Python, Pydantic AI & LLM client version
0.4.6