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

feat: babyagi agent support #243

Merged
merged 29 commits into from
Oct 2, 2023
Merged

feat: babyagi agent support #243

merged 29 commits into from
Oct 2, 2023

Conversation

hychen-naza
Copy link
Contributor

@hychen-naza hychen-naza commented Aug 6, 2023

Description

Build Babyagi by composing chat agent (task solver) and task agent (task planner)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Example (update in the folder of example)

Implemented Tasks

  • Subtask 1: Add babyagi under camel/society folder
  • Subtask 2: Make an example file in example folder

Checklist

@hychen-naza hychen-naza marked this pull request as draft August 6, 2023 19:07
@lightaime
Copy link
Member

Thanks, @hychen-naza. But it seems the PR is outdated from the master. Should we add the new changes by branching from the current master branch?

@hychen-naza hychen-naza changed the title task agent new Babyagi Aug 6, 2023
@hychen-naza
Copy link
Contributor Author

hychen-naza commented Aug 6, 2023

I was branching from the master branch.
If you are talking about the modification in task agent, I just add some new changes to make Babyagi run smoother. @lightaime

The demo video is the one I shared few days ago.

Small issue: I notice I have to specify the chat window size and task history size to avoid max token error. Let me know if you think if it's good or not.

@hychen-naza hychen-naza marked this pull request as ready for review August 6, 2023 22:08
@hychen-naza hychen-naza self-assigned this Aug 6, 2023
Copy link
Collaborator

@Obs01ete Obs01ete left a comment

Choose a reason for hiding this comment

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

Overall good. Small changes requested.

camel/agents/task_agent.py Outdated Show resolved Hide resolved
camel/agents/task_agent.py Outdated Show resolved Hide resolved
self.task_prompt,
meta_dict=task_specify_meta_dict,
)
self.task_prompt = self.specified_task_prompt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Overwriting self.task_prompt does not seem right. Why do we need self.specified_task_prompt then?

Please avoid mutation of fields. Also initialize a field only in one method. Both self.task_prompt and self.specified_task_prompt must be initialized in one method: init_specified_task_prompt in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your comments.

I noticed the self.specified_task_prompt would lead to more concrete task planning and better task execution result. Otherwise, the user-input task prompt is too high-level to get useful results.

And, I avoid overwriting the self.task_prompt and initialize self.specified_task_prompt in init_specified_task_prompt method.

camel/agents/task_agent.py Outdated Show resolved Hide resolved
camel/societies/babyagi_playing.py Outdated Show resolved Hide resolved
camel/societies/babyagi_playing.py Show resolved Hide resolved
camel/societies/babyagi_playing.py Show resolved Hide resolved
@lightaime
Copy link
Member

Thanks for the PR @hychen-naza. Part of the PR is outdated with the current master in task_agent.py. I guess this is because I changed some things in the task_agent.py while you did not pull the master branch. Could we fix that?

@hychen-naza
Copy link
Contributor Author

Yeah, I am gonna fix the file conflicts and other comments proposed.

@hychen-naza
Copy link
Contributor Author

hychen-naza commented Aug 22, 2023

I notice some tests in test_search_functions.py are failed, may need to check that tests. They are passed last night, so I guess they might fail with some probabilities.

Copy link
Member

@lightaime lightaime left a comment

Choose a reason for hiding this comment

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

Thanks @hychen-naza. That is an elegant implementation of BabyAGI with CAMEL!

It looks good overall. Left some minor comments.

camel/agents/__init__.py Outdated Show resolved Hide resolved
camel/agents/__init__.py Outdated Show resolved Hide resolved
camel/agents/task_agent.py Outdated Show resolved Hide resolved
camel/agents/task_agent.py Outdated Show resolved Hide resolved
camel/agents/task_agent.py Outdated Show resolved Hide resolved
camel/societies/babyagi_playing.py Outdated Show resolved Hide resolved
camel/societies/babyagi_playing.py Outdated Show resolved Hide resolved
camel/societies/babyagi_playing.py Outdated Show resolved Hide resolved
examples/ai_society/babyagi_playing.py Show resolved Hide resolved
examples/ai_society/babyagi_playing.py Show resolved Hide resolved
@lightaime lightaime added Agent Related to camel agents Society labels Sep 9, 2023
@dandansamax dandansamax mentioned this pull request Sep 14, 2023
14 tasks
@Obs01ete
Copy link
Collaborator

@hychen-naza Are you working on this PR? Comments by @lightaime did not get addressed. I think we can merge this for 0.2 release. But the PR has to be finished first. You did a great job and it would be a shame if it does not make its way tho the release.

@Benjamin-eecs Benjamin-eecs changed the title Babyagi feat: babyagi agent support Sep 18, 2023
Copy link
Collaborator

@Obs01ete Obs01ete left a comment

Choose a reason for hiding this comment

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

Please resolve all conversations before asking for a code review.

@hychen-naza
Copy link
Contributor Author

hychen-naza commented Sep 24, 2023

I know my response is late.. I fixed most of the comments and left some feedback. And lmk if you have any other comments or suggestions.

Copy link
Collaborator

@Obs01ete Obs01ete left a comment

Choose a reason for hiding this comment

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

All good! I approve, but please wait for the approval by @lightaime before merging.

examples/ai_society/babyagi_playing.py Show resolved Hide resolved
@Obs01ete Obs01ete merged commit 50c9c97 into master Oct 2, 2023
8 checks passed
@Obs01ete Obs01ete deleted the babyagi branch October 2, 2023 13:58
@lightaime
Copy link
Member

lightaime commented Oct 4, 2023

Thanks for the PR @hychen-naza!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agent Related to camel agents Society
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants