Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Graph.iter into an _async_ contextmanager #958

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dmontagu
Copy link
Contributor

This makes the Graph.iter(...) and Agent.iter(...) methods async context managers instead of sync context managers.

I'm not totally convinced we should make this change, but it would definitely make it easier to do async stuff inside these contextmanagers if we ever wanted to in the future; otherwise we'd need to introduce a fairly egregious breaking change (all with ....iter(...): needs to become async with ....iter(...):.

Opening as a reminder to revisit this decision in the near future.

Copy link

Docs Preview

commit: 6a569df
Preview URL: https://1fc26a18-pydantic-ai-previews.pydantic.workers.dev

@dmontagu dmontagu changed the title Make graph iteration async Make Graph.iter into an _async_ contextmanager Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant