From 4ba3d6e1b45ffc7bd53d8bef3991da487973ce57 Mon Sep 17 00:00:00 2001 From: LinxinS97 Date: Mon, 4 Dec 2023 10:33:25 +0800 Subject: [PATCH 1/2] try to fix blog --- website/blog/2023-11-26-Agent-AutoBuild/index.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/website/blog/2023-11-26-Agent-AutoBuild/index.mdx b/website/blog/2023-11-26-Agent-AutoBuild/index.mdx index 5b9c9804b21b..06285ed92eb1 100644 --- a/website/blog/2023-11-26-Agent-AutoBuild/index.mdx +++ b/website/blog/2023-11-26-Agent-AutoBuild/index.mdx @@ -1,4 +1,3 @@ - --- title: Agent AutoBuild - Automatically Building Multi-agent Systems authors: From 58c19f4bf0fd5cb30453c589bce7736738f0fc97 Mon Sep 17 00:00:00 2001 From: LinxinS97 Date: Mon, 4 Dec 2023 11:08:30 +0800 Subject: [PATCH 2/2] modify blog --- .../blog/2023-11-26-Agent-AutoBuild/index.mdx | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/website/blog/2023-11-26-Agent-AutoBuild/index.mdx b/website/blog/2023-11-26-Agent-AutoBuild/index.mdx index 06285ed92eb1..a5c26cddb556 100644 --- a/website/blog/2023-11-26-Agent-AutoBuild/index.mdx +++ b/website/blog/2023-11-26-Agent-AutoBuild/index.mdx @@ -69,15 +69,29 @@ building_task = "Find a paper on arxiv by programming, and analysis its applicat Use `build()` to let build manager (with a `builder_model` as backbone) complete the group chat agents generation. 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: ```python -builder.build(building_task, default_llm_config, coding=True) +agent_list, agent_configs = builder.build(building_task, default_llm_config, coding=True) ``` If `coding` is not specified, AgentBuilder will determine on its own whether the user proxy should be added or not according to the task. ### Step 5: execute the task Let agents generated in `build()` to complete the task collaboratively in a group chat. ```python -execution_task="Find a latest paper about gpt-4 on arxiv and find its potential applications in software." -builder.start(task=execution_task) +import autogen + +def start_task(execution_task: str, agent_list: list, llm_config: dict): + config_list = autogen.config_list_from_json(config_path, filter_dict={"model": ["gpt-4-1106-preview"]}) + + group_chat = autogen.GroupChat(agents=agent_list, messages=[], max_round=12) + manager = autogen.GroupChatManager( + groupchat=group_chat, llm_config={"config_list": config_list, **llm_config} + ) + agent_list[0].initiate_chat(manager, message=execution_task) + +start_task( + execution_task="Find a recent paper about gpt-4 on arxiv and find its potential applications in software.", + agent_list=agent_list, + llm_config=default_llm_config +) ``` ### 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 You can load the saved config and skip the building process. AgentBuilder will create agents with those information without prompting the build manager. ```python -new_builder = AgentBuilder(config_path=config_path).load(saved_path) -new_builder.start() +new_builder = AgentBuilder(config_path=config_path) +agent_list, agent_config = new_builder.load(saved_path) +start_task(...) # skip build() ``` ## Use Open-source LLM @@ -138,14 +153,18 @@ After satisfying the requirements, you can add an open-source LLM's huggingface and specify it when initializing AgentBuilder. AgentBuilder will automatically set up an endpoint server for open-source LLM. Make sure you have sufficient GPUs resources. -## Use GPTs -[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. -AutoBuild also support GPTs api by adding `use_gpts=True` to the `build()` function. +## Use OpenAI Assistant +[Assistants API](https://platform.openai.com/docs/assistants/overview) allows you to build AI assistants within your own applications. +An Assistant has instructions and can leverage models, tools, and knowledge to respond to user queries. +AutoBuild also support assistant api by adding `use_oai_assistant=True` to `build()`. ```python -# Transfer to GPTs API. -new_builder.build(building_task, default_llm_config, use_gpts=True) +# Transfer to OpenAI Assistant API. +agent_list, agent_config = new_builder.build(building_task, default_llm_config, use_oai_assistant=True) +... ``` ## Summary -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. +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. More related features coming soon.