-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
add auto build agent feature #5670
base: main
Are you sure you want to change the base?
Conversation
enhanced_sys_msg = GROUP_CHAT_DESCRIPTION.format( | ||
name=agent_name, members=member_name, code_executor_desc=code_executor_desc, sys_msg=system_message | ||
) | ||
await agent.update_system_message(enhanced_sys_msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than updating, can we create the agent once all the parameters are ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, l will fix it
|
||
return self._build_agents(use_oai_assistant, code_executor=code_executor, **kwargs) | ||
|
||
async def _build_agents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AssistantAgent
has built-in functions for serialization and loading. See example: https://microsoft.github.io/autogen/dev/user-guide/agentchat-user-guide/serialize-components.html#agent-example
I think we should be using the built-in API for agent library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, but here I'm not just managing agent configurations, but focus on task configurations. and The base_url and api_key in the agent configuration should not be saved but should be loaded in real-time.
l need save the task config like:{
"building_task": "... ",
"agent_configs": [
{
"name": "...",
"system_message": "...",
"description": "...."
},
....
],
"coding": true,
"code_execution_config": {
"last_n_messages": 2,
"work_dir": "....",
"timeout": 60,
"use_docker": "python:3"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, though consider use a BaseModel for your configuration type so we are type checking and validation automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to do this without changing AssistantAgent
.
When registered tools need to be updated, why not create new agent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean even if you create a new agent with some tools, the registered tools are hardcoded. However, in the Autobuild class, tools can be dynamically registered to an agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put it inside autogen_ext.auto_build
as a separate module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
self.agent_configs: List[Dict] = [] | ||
self.open_ports: List[str] = [] | ||
self.agent_procs: Dict[str, Tuple[sp.Popen, str]] = {} | ||
self.agent_procs_assign: Dict[str, Tuple[AssistantAgent, str]] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for running agents in separate processes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no,This code is hard to understand. I will optimize it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you are interested in concurrent running agents, the Core API is a good way to look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
I will add test code later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victordibia would you like to take a look at this? Perhaps it can be a feature in AGS.
self.agent_configs: List[Dict] = [] | ||
self.open_ports: List[str] = [] | ||
self.agent_procs: Dict[str, Tuple[sp.Popen, str]] = {} | ||
self.agent_procs_assign: Dict[str, Tuple[AssistantAgent, str]] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you are interested in concurrent running agents, the Core API is a good way to look into it.
Why are these changes needed?
there is an AutoBuild feature on the 0.2 branch( https://microsoft.github.io/autogen/0.2/blog/2023/11/26/Agent-AutoBuild/), and I want to add this feature
Related issue number
#5573
Checks