Skip to content

Conversation

dmontagu
Copy link
Contributor

@dmontagu dmontagu commented Apr 8, 2025

Changes the __aiter__ API for graphs (and consequently agents) to start by yielding the initial input node as the first output of the iterator, rather than skipping that node and only yielding the outputs of calling next (as it currently does).

Closes #1347

Copy link
Contributor

hyperlint-ai bot commented Apr 8, 2025

PR Change Summary

Yield initial node during graph iteration to enhance user interaction with the graph structure.

  • Added UserPromptNode to the graph iteration process
  • Updated output messages to include user prompts
  • Modified documentation to reflect changes in node behavior

Modified Files

  • docs/agents.md
  • docs/graph.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@dmontagu dmontagu changed the title Yield initial node during graph iteration Yield initial node during Graph (and therefore Agent) iteration Apr 8, 2025
Copy link

github-actions bot commented Apr 8, 2025

Docs Preview

commit: 4212b06
Preview URL: https://974a3914-pydantic-ai-previews.pydantic.workers.dev

@dmontagu dmontagu merged commit 593ff0e into main Apr 8, 2025
17 checks passed
@dmontagu dmontagu deleted the dmontagu/yield-initial-node branch April 8, 2025 22:30
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.

Agent async iteration skips userprompt node?
2 participants