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

wip: refactor query pipeline agent to use stateful function components #14263

Open
wants to merge 4 commits into
base: jerry/add_loop_component
Choose a base branch
from

Conversation

jerryjliu
Copy link
Collaborator

this should be a cleaner UX than the old guide which made users use AgentInputComponent and AgentFnComponent to define an agentic query pipeline.

Here you can define a query pipeline through a single abstraction StatefulFnComponent:

  • no more two separate component classes (which didn't make sense)
  • single state dictionary passed around (instead of both task and step state)
  • use same abstractions as LoopComponent

When you wrap a query pipeline with an agent worker, the task and step.step_state are injected in the state dictionary of every stateful component.

This also makes it easier to test the query pipeline used for an agent in isolation. Just initialize the state dictionary of the query pipeline with task and step.step_state, and do pipeline.run()

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jun 20, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jerryjliu jerryjliu changed the base branch from main to jerry/add_loop_component June 20, 2024 07:00
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant