Go to file
Davor Runje 2589ae8749
Add documentation and raise exception when registering async reply function in sync chat (#1208)
* documentation update and added tests for register_reply function

* added raising an exception on an async reply function in sync chat

* big fixing

* test expanded

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* refactorization

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-01-13 07:35:31 +00:00
.devcontainer upgrade base image to the latest Debian (Bookworm) (#1133) 2024-01-03 17:40:43 +00:00
.github Change `contrib-tests.yml` tests to use `--skip-openai` (#1132) 2024-01-10 01:42:07 +00:00
autogen Add documentation and raise exception when registering async reply function in sync chat (#1208) 2024-01-13 07:35:31 +00:00
dotnet [Dotnet] Add dotnet build workflow (#946) 2023-12-30 02:23:12 +00:00
notebook Fix registration of async functions (#1201) 2024-01-11 09:01:58 +00:00
samples Update studio README.md with badges (#1225) 2024-01-13 04:29:28 +00:00
test Add documentation and raise exception when registering async reply function in sync chat (#1208) 2024-01-13 07:35:31 +00:00
website Bump follow-redirects from 1.15.2 to 1.15.4 in /website (#1189) 2024-01-10 17:38:09 +00:00
.coveragerc Sample Web Application Built with AutoGen (#695) 2023-11-20 18:40:30 +00:00
.gitignore Teachability for any agent (#1091) 2024-01-07 19:59:42 +00:00
.pre-commit-config.yaml nbqa adedd to pre-commit, added black and ruff for notebooks (#1171) 2024-01-08 03:47:01 +00:00
CITATION.cff Add examples (#851) 2023-12-03 23:46:38 +00:00
CODE_OF_CONDUCT.md v0.1.0 2020-12-04 09:40:27 -08:00
LICENSE cleanup 2023-09-19 12:38:26 +00:00
LICENSE-CODE LICENSE-CODE committed 2023-08-18 04:43:49 -07:00
OAI_CONFIG_LIST_sample Remove GPT-4 as the default model. (#1072) 2024-01-05 14:27:48 +00:00
README.md guide on the usage of docker (#1111) 2024-01-08 02:36:04 +00:00
SECURITY.md cleanup 2023-09-19 12:38:26 +00:00
TRANSPARENCY_FAQS.md Update TRANSPARENCY_FAQS.md (#492) 2023-11-05 18:08:35 +00:00
pyproject.toml pyproject.toml & switch to Ruff (#976) 2023-04-28 01:54:55 +00:00
setup.py [AutoBuild] Supporting build agents from library; supporting generating agent descriptions (#1039) 2024-01-06 17:23:23 +00:00

README.md

PyPI version Build Python Version Downloads Twitter

AutoGen

📚 Cite paper.

🔥 Dec 31: AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework is selected by TheSequence: My Five Favorite AI Papers of 2023.

🔥 Nov 8: AutoGen is selected into Open100: Top 100 Open Source achievements 35 days after spinoff.

🔥 Nov 6: AutoGen is mentioned by Satya Nadella in a fireside chat around 13:20.

🔥 Nov 1: AutoGen is the top trending repo on GitHub in October 2023.

🎉 Oct 03: AutoGen spins off from FLAML on Github and has a major paper update (first version on Aug 16).

🎉 Mar 29: AutoGen is first created in FLAML.

What is AutoGen

AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks. AutoGen agents are customizable, conversable, and seamlessly allow human participation. They can operate in various modes that employ combinations of LLMs, human inputs, and tools.

AutoGen Overview

  • AutoGen enables building next-gen LLM applications based on multi-agent conversations with minimal effort. It simplifies the orchestration, automation, and optimization of a complex LLM workflow. It maximizes the performance of LLM models and overcomes their weaknesses.
  • It supports diverse conversation patterns for complex workflows. With customizable and conversable agents, developers can use AutoGen to build a wide range of conversation patterns concerning conversation autonomy, the number of agents, and agent conversation topology.
  • It provides a collection of working systems with different complexities. These systems span a wide range of applications from various domains and complexities. This demonstrates how AutoGen can easily support diverse conversation patterns.
  • AutoGen provides enhanced LLM inference. It offers utilities like API unification and caching, and advanced usage patterns, such as error handling, multi-config inference, context programming, etc.

AutoGen is powered by collaborative research studies from Microsoft, Penn State University, and the University of Washington.

Quickstart

The easiest way to start playing is

  1. Click below to use the GitHub Codespace

    Open in GitHub Codespaces

  2. Copy OAI_CONFIG_LIST_sample to ./notebook folder, name to OAI_CONFIG_LIST, and set the correct configuration.

  3. Start playing with the notebooks!

NOTE: OAI_CONFIG_LIST_sample lists GPT-4 as the default model, as this represents our current recommendation, and is known to work well with AutoGen. If you use a model other than GPT-4, you may need to revise various system prompts (especially if using weaker models like GPT-3.5-turbo). Moreover, if you use models other than those hosted by OpenAI or Azure, you may incur additional risks related to alignment and safety. Proceed with caution if updating this default.

Installation

Option 1. Install and Run AutoGen in Docker

Find detailed instructions for users here, and for developers here.

Option 2. Install AutoGen Locally

AutoGen requires Python version >= 3.8, < 3.12. It can be installed from pip:

pip install pyautogen

Minimal dependencies are installed without extra options. You can install extra options based on the feature you need.

Find more options in Installation.

Even if you are installing AutoGen locally out of docker, we recommend performing code execution in docker. Find more instructions here.

For LLM inference configurations, check the FAQs.

Multi-Agent Conversation Framework

Autogen enables the next-gen LLM applications with a generic multi-agent conversation framework. It offers customizable and conversable agents that integrate LLMs, tools, and humans. By automating chat among multiple capable agents, one can easily make them collectively perform tasks autonomously or with human feedback, including tasks that require using tools via code.

Features of this use case include:

  • Multi-agent conversations: AutoGen agents can communicate with each other to solve tasks. This allows for more complex and sophisticated applications than would be possible with a single LLM.
  • Customization: AutoGen agents can be customized to meet the specific needs of an application. This includes the ability to choose the LLMs to use, the types of human input to allow, and the tools to employ.
  • Human participation: AutoGen seamlessly allows human participation. This means that humans can provide input and feedback to the agents as needed.

For example,

from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
# Load LLM inference endpoints from an env variable or a file
# See https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
# and OAI_CONFIG_LIST_sample
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
# You can also set config_list directly as a list, for example, config_list = [{'model': 'gpt-4', 'api_key': '<your OpenAI API key here>'},]
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding"})
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
# This initiates an automated chat between the two agents to solve the task

This example can be run with

python test/twoagent.py

After the repo is cloned. The figure below shows an example conversation flow with AutoGen. Agent Chat Example

Alternatively, the sample code here allows a user to chat with an AutoGen agent in ChatGPT style. Please find more code examples for this feature.

Enhanced LLM Inferences

Autogen also helps maximize the utility out of the expensive LLMs such as ChatGPT and GPT-4. It offers enhanced LLM inference with powerful functionalities like caching, error handling, multi-config inference and templating.

Documentation

You can find detailed documentation about AutoGen here.

In addition, you can find:

AutoGen

@inproceedings{wu2023autogen,
      title={AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework},
      author={Qingyun Wu and Gagan Bansal and Jieyu Zhang and Yiran Wu and Beibin Li and Erkang Zhu and Li Jiang and Xiaoyun Zhang and Shaokun Zhang and Jiale Liu and Ahmed Hassan Awadallah and Ryen W White and Doug Burger and Chi Wang},
      year={2023},
      eprint={2308.08155},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}

EcoOptiGen

@inproceedings{wang2023EcoOptiGen,
    title={Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference},
    author={Chi Wang and Susan Xueqing Liu and Ahmed H. Awadallah},
    year={2023},
    booktitle={AutoML'23},
}

MathChat

@inproceedings{wu2023empirical,
    title={An Empirical Study on Challenging Math Problem Solving with GPT-4},
    author={Yiran Wu and Feiran Jia and Shaokun Zhang and Hangyu Li and Erkang Zhu and Yue Wang and Yin Tat Lee and Richard Peng and Qingyun Wu and Chi Wang},
    year={2023},
    booktitle={ArXiv preprint arXiv:2306.01337},
}

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

If you are new to GitHub here is a detailed help source on getting involved with development on GitHub.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Contributors Wall

Legal Notices

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure, and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel, or otherwise.