Skip to content

Commit 03f9264

Browse files
authored
AutoBuild blog refinement (microsoft#856)
* try to fix blog * modify blog
1 parent 82d5c2f commit 03f9264

File tree

1 file changed

+30
-11
lines changed
  • website/blog/2023-11-26-Agent-AutoBuild

1 file changed

+30
-11
lines changed

website/blog/2023-11-26-Agent-AutoBuild/index.mdx

+30-11
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,29 @@ building_task = "Find a paper on arxiv by programming, and analysis its applicat
6969
Use `build()` to let build manager (with a `builder_model` as backbone) complete the group chat agents generation.
7070
If you think coding is necessary in your task, you can use `coding=True` to add a user proxy (a local code interpreter) into the agent list as:
7171
```python
72-
builder.build(building_task, default_llm_config, coding=True)
72+
agent_list, agent_configs = builder.build(building_task, default_llm_config, coding=True)
7373
```
7474
If `coding` is not specified, AgentBuilder will determine on its own whether the user proxy should be added or not according to the task.
7575

7676
### Step 5: execute the task
7777
Let agents generated in `build()` to complete the task collaboratively in a group chat.
7878
```python
79-
execution_task="Find a latest paper about gpt-4 on arxiv and find its potential applications in software."
80-
builder.start(task=execution_task)
79+
import autogen
80+
81+
def start_task(execution_task: str, agent_list: list, llm_config: dict):
82+
config_list = autogen.config_list_from_json(config_path, filter_dict={"model": ["gpt-4-1106-preview"]})
83+
84+
group_chat = autogen.GroupChat(agents=agent_list, messages=[], max_round=12)
85+
manager = autogen.GroupChatManager(
86+
groupchat=group_chat, llm_config={"config_list": config_list, **llm_config}
87+
)
88+
agent_list[0].initiate_chat(manager, message=execution_task)
89+
90+
start_task(
91+
execution_task="Find a recent paper about gpt-4 on arxiv and find its potential applications in software.",
92+
agent_list=agent_list,
93+
llm_config=default_llm_config
94+
)
8195
```
8296

8397
### Step 6 (Optional): clear all agents and prepare for the next task
@@ -117,8 +131,9 @@ You can provide a specific filename, otherwise, AgentBuilder will save config to
117131

118132
You can load the saved config and skip the building process. AgentBuilder will create agents with those information without prompting the build manager.
119133
```python
120-
new_builder = AgentBuilder(config_path=config_path).load(saved_path)
121-
new_builder.start()
134+
new_builder = AgentBuilder(config_path=config_path)
135+
agent_list, agent_config = new_builder.load(saved_path)
136+
start_task(...) # skip build()
122137
```
123138

124139
## Use Open-source LLM
@@ -138,14 +153,18 @@ After satisfying the requirements, you can add an open-source LLM's huggingface
138153
and specify it when initializing AgentBuilder.
139154
AgentBuilder will automatically set up an endpoint server for open-source LLM. Make sure you have sufficient GPUs resources.
140155

141-
## Use GPTs
142-
[GPTs](https://openai.com/blog/introducing-gpts) allow user to create an assistant with a simple instruction of the task. It has plugin support that can let ChatGPT complete some complex instructions, and can optionally update the assistant's instruction to let it adapt to new task or improve on the current task.
143-
AutoBuild also support GPTs api by adding `use_gpts=True` to the `build()` function.
156+
## Use OpenAI Assistant
157+
[Assistants API](https://platform.openai.com/docs/assistants/overview) allows you to build AI assistants within your own applications.
158+
An Assistant has instructions and can leverage models, tools, and knowledge to respond to user queries.
159+
AutoBuild also support assistant api by adding `use_oai_assistant=True` to `build()`.
144160
```python
145-
# Transfer to GPTs API.
146-
new_builder.build(building_task, default_llm_config, use_gpts=True)
161+
# Transfer to OpenAI Assistant API.
162+
agent_list, agent_config = new_builder.build(building_task, default_llm_config, use_oai_assistant=True)
163+
...
147164
```
148165

149166
## Summary
150-
We propose AutoBuild with a new class `AgentBuilder`. AutoBuild can help user solve their complex task with an automatically built multi-agent system. AutoBuild support open-source LLMs and GPTs api, giving users more flexibility to choose their favorite models.
167+
We propose AutoBuild with a new class `AgentBuilder`.
168+
AutoBuild can help user solve their complex task with an automatically built multi-agent system.
169+
AutoBuild support open-source LLMs and GPTs api, giving users more flexibility to choose their favorite models.
151170
More related features coming soon.

0 commit comments

Comments
 (0)