Skip to content

add simple function agent #14329

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

Merged
merged 3 commits into from
Jun 24, 2024
Merged

Conversation

jerryjliu
Copy link
Collaborator

one of the easiest ways to define an agent - just define a function with a state dictionary and run it until is_done is True

see unit test as an example

cr
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 23, 2024
def test_fn_agent() -> None:
"""Test function agent."""

agent = FnAgentWorker(fn=mock_foo_fn, initial_state={"max_count": 5}).as_agent()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead simple, love it

cr
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 23, 2024
cr
@logan-markewich logan-markewich merged commit db0e2ef into main Jun 24, 2024
8 checks passed
@logan-markewich logan-markewich deleted the jerry/add_simple_function_agent branch June 24, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants