autogen/website/docs/Examples.md

100 lines
9.0 KiB
Markdown
Raw Normal View History

# Examples
## Automated Multi Agent Chat
2023-08-27 21:30:54 -04:00
AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation via multi-agent conversation.
2023-09-02 21:58:13 -04:00
Please find documentation about this feature [here](/docs/Use-Cases/agent_chat).
2023-08-27 21:30:54 -04:00
Links to notebook examples:
1. **Code Generation, Execution, and Debugging**
- Automated Task Solving with Code Generation, Execution & Debugging - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb)
- Automated Code Generation and Question Answering with Retrieval Augmented Agents - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_RetrieveChat.ipynb)
- Automated Code Generation and Question Answering with [Qdrant](https://qdrant.tech/) based Retrieval Augmented Agents - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_qdrant_RetrieveChat.ipynb)
1. **Multi-Agent Collaboration (>3 Agents)**
- Automated Task Solving by Group Chat (with 3 group member agents and 1 manager agent) - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_groupchat.ipynb)
- Automated Data Visualization by Group Chat (with 3 group member agents and 1 manager agent) - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_groupchat_vis.ipynb)
- Automated Complex Task Solving by Group Chat (with 6 group member agents and 1 manager agent) - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_groupchat_research.ipynb)
- Automated Task Solving with Coding & Planning Agents - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_planning.ipynb)
- Automated Task Solving with transition paths specified in a graph - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_graph_modelling_language_using_select_speaker.ipynb)
- Running a group chat as an inner-monolgue via the SocietyOfMindAgent - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_society_of_mind.ipynb)
1. **Applications**
- Automated Chess Game Playing & Chitchatting by GPT-4 Agents - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_chess.ipynb)
- Automated Continual Learning from New Data - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_stream.ipynb)
- [OptiGuide](https://github.com/microsoft/optiguide) - Coding, Tool Using, Safeguarding & Question Answering for Supply Chain Optimization
1. **Tool Use**
- **Web Search**: Solve Tasks Requiring Web Info - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_web_info.ipynb)
- Use Provided Tools as Functions - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_function_call.ipynb)
- Use Tools via Sync and Async Function Calling - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_function_call_async.ipynb)
- Task Solving with Langchain Provided Tools as Functions - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_langchain.ipynb)
- **RAG**: Group Chat with Retrieval Augmented Generation (with 5 group member agents and 1 manager agent) - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_groupchat_RAG.ipynb)
- Function Inception: Enable AutoGen agents to update/remove functions during conversations. - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_inception_function.ipynb)
- Agent Chat with Whisper - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_video_transcript_translate_with_whisper.ipynb)
- Constrained Responses via Guidance - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_guidance.ipynb)
- Browse the Web with Agents - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_surfer.ipynb)
- **SQL**: Natural Language Text to SQL Query using the [Spider](https://yale-lily.github.io/spider) Text-to-SQL Benchmark - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_sql_spider.ipynb)
1. **Human Involvement**
- Simple example in ChatGPT style [View example](https://github.com/microsoft/autogen/blob/main/samples/simple_chat.py)
- Auto Code Generation, Execution, Debugging and **Human Feedback** - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_human_feedback.ipynb)
- Automated Task Solving with GPT-4 + **Multiple Human Users** - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_two_users.ipynb)
- Agent Chat with **Async Human Inputs** - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/Async_human_input.ipynb)
1. **Agent Teaching and Learning**
- Teach Agents New Skills & Reuse via Automated Chat - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_teaching.ipynb)
2023-10-22 00:08:59 -04:00
- Teach Agents New Facts, User Preferences and Skills Beyond Coding - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_teachability.ipynb)
- Teach OpenAI Assistants Through GPTAssistantAgent - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_teachable_oai_assistants.ipynb)
- Agent Optimizer: Train Agents in an Agentic Way - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_agentoptimizer.ipynb)
1. **Multi-Agent Chat with OpenAI Assistants in the loop**
- Hello-World Chat with OpenAi Assistant in AutoGen - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_oai_assistant_twoagents_basic.ipynb)
- Chat with OpenAI Assistant using Function Call - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_oai_assistant_function_call.ipynb)
- Chat with OpenAI Assistant with Code Interpreter - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_oai_code_interpreter.ipynb)
- Chat with OpenAI Assistant with Retrieval Augmentation - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_oai_assistant_retrieval.ipynb)
- OpenAI Assistant in a Group Chat - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_oai_assistant_groupchat.ipynb)
1. **Multimodal Agent**
- Multimodal Agent Chat with DALLE and GPT-4V - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_dalle_and_gpt4v.ipynb)
- Multimodal Agent Chat with Llava - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_lmm_llava.ipynb)
- Multimodal Agent Chat with GPT-4V - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_lmm_gpt-4v.ipynb)
1. **Long Context Handling**
- Conversations with Chat History Compression Enabled - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_compression.ipynb)
1. **Evaluation and Assessment**
- AgentEval: A Multi-Agent System for Assess Utility of LLM-powered Applications - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/agenteval_cq_math.ipynb)
Testing AutoBuild (#846) * init notebook for agent set up * complete AgentCreator * AgentCreator first step features completed. * update AgentCreator * update AgentCreator * update AgentCreator (modify params of build) * [update AgentCreator] add auto judgement of coding * add autobuild * rename autobuild notebook * Add step-by-step command. * modify name * fix bugs * update for new openai api * add example * add load_config, save_config, and add task in build and start * modify notebook * rewrite save and load function; update notebook * update description * update description * update description * change member variable of agent_creator.py * update notebook * new feature: auto-generate agent name and system message * new feature: add gpts support * update notebook * update notebook * beautify; add docstring for build * Update notebook; PR version * typo * update notebook * fix typo * try to run llama * try to run llama * switch api_base to base_url * add details for Step 6; add print in clear_all_agents() * Change description of Step 5 * delete ASSISTANT_CONFIG_LIST * add Linxin to blog authors * add blog * Update index.mdx * add test; add user proxy constrain; change show case in notebook * modify blog for test * change test file name; modify test * modify test * modify test * add try/catch for dependency * add version requirement for openai * add exception for DistributionNotFound error * add requirement * change assertion * rename test; modify index.mdx * change config file name * Update agent_chat.md * Update agent_chat.md * Update AgentChat.md * complete blog; fix typos in notebook * add autobuild banner * try to merge * Update Examples.md * update test * skip if openai not installed * pre-commit * Update website/blog/2023-11-26-Agent-AutoBuild/index.mdx Co-authored-by: Chi Wang <wang.chi@microsoft.com> * update contrib-openai.yml * change pull_request_target to pull_request * disable other openai tests * address issues from ekzhu; modify notebook; modify blog; modify test * update test example * update test * Update agent_chat.md * Update Examples.md * address issues from qingyun; update agent_builder.py; update notebook * recover contrib-openai.yml * pre-commit solve --------- Co-authored-by: Jieyu Zhang <jieyuz2@cs.washington.edu> Co-authored-by: JieyuZ2 <jieyuzhang97@gmail.com> Co-authored-by: Chi Wang <wang.chi@microsoft.com> Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>
2023-12-04 11:12:26 +09:00
1. **Automatic Agent Building**
[AutoBuild] Supporting build agents from library; supporting generating agent descriptions (#1039) * try to fix blog * modify blog * fix test error in #717; fix blog typo in installation; update blogs with output examples. * pre-commit * pre-commit * Update website/blog/2023-11-26-Agent-AutoBuild/index.mdx Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu> * add future work * fix grammar * update agent_builder * solve #941; add detailed debug info; support json string config * pre-commit * solve #954 * pre-commit * [new feature] build group chat agents from library. * pre-commit * add authors' info in notebook; add a new notebook for build_from_library; reduce prompt effort * update test and example for build_from_library * pre-commit * add notebook; update docs * change notebook name * change description for notebook and doc * remove default value for default_llm_config * add embedding similarity agent selection * pre-commit * update test * add dependency installation in github workflow * update test * pre-commit * update notebook * support directly json as library; support customize embedding model * update test * pre-commit * update github test workflow * Update autobuild_agent_library.ipynb * add agent description * refine prompt; update notebook * pre-commit * update test example * update test * update test * update test * change `config_path` to `config_path_or_env`; update test * pre-commit * update test * update test * update test: add config_file_location * change `config_path_or_env` to `config_file_or_env` * update test * solve noqa * fix import error for conftest * fix test error * pre-commit * * update error message in `_create_agent`. * replace `gpt-4-1106-preview` to `gpt-4` in test file. * add comment on local server creation; modify notebook; update contrib-openai.yml for test; add autobuild option in setup.py; add autotest model name statement * move import huggingface_hub to _create_agent * pre-commit * add uncover comment in the endpoint creation code block * recover contrib-openai.yml for merge --------- Co-authored-by: Jieyu Zhang <jieyuz2@cs.washington.edu> Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>
2024-01-07 02:23:23 +09:00
- Automatically Build Multi-agent System with AgentBuilder - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/autobuild_basic.ipynb)
- Automatically Build Multi-agent System from Agent Library - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/autobuild_agent_library.ipynb)
## Enhanced Inferences
### Utilities
- API Unification - [View Documentation with Code Example](https://microsoft.github.io/autogen/docs/Use-Cases/enhanced_inference/#api-unification)
- Utility Functions to Help Managing API configurations effectively - [View Notebook](/docs/llm_endpoint_configuration)
- Cost Calculation - [View Notebook](https://github.com/microsoft/autogen/blob/main/notebook/oai_client_cost.ipynb)
### Inference Hyperparameters Tuning
AutoGen offers a cost-effective hyperparameter optimization technique [EcoOptiGen](https://arxiv.org/abs/2303.04673) for tuning Large Language Models. The research study finds that tuning hyperparameters can significantly improve the utility of them.
Please find documentation about this feature [here](/docs/Use-Cases/enhanced_inference).
Links to notebook examples:
* [Optimize for Code Generation](https://github.com/microsoft/autogen/blob/main/notebook/oai_completion.ipynb) | [Open in colab](https://colab.research.google.com/github/microsoft/autogen/blob/main/notebook/oai_completion.ipynb)
* [Optimize for Math](https://github.com/microsoft/autogen/blob/main/notebook/oai_chatgpt_gpt4.ipynb) | [Open in colab](https://colab.research.google.com/github/microsoft/autogen/blob/main/notebook/oai_chatgpt_gpt4.ipynb)