You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Getting-Started.md 5.4 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Getting Started
  2. <!-- ### Welcome to AutoGen, a library for enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework! -->
  3. AutoGen is a framework that enables 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.
  4. ![AutoGen Overview](/img/autogen_agentchat.png)
  5. ### Main Features
  6. - AutoGen enables building next-gen LLM applications based on [multi-agent conversations](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat) 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.
  7. - It supports [diverse conversation patterns](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat#supporting-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,
  8. the number of agents, and agent conversation topology.
  9. - It provides a collection of working systems with different complexities. These systems span a [wide range of applications](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat#diverse-applications-implemented-with-autogen) from various domains and complexities. This demonstrates how AutoGen can easily support diverse conversation patterns.
  10. - AutoGen provides [enhanced LLM inference](https://microsoft.github.io/autogen/docs/Use-Cases/enhanced_inference#api-unification). It offers utilities like API unification and caching, and advanced usage patterns, such as error handling, multi-config inference, context programming, etc.
  11. AutoGen is powered by collaborative [research studies](/docs/Research) from Microsoft, Penn State University, and University of Washington.
  12. ### Quickstart
  13. Install from pip: `pip install pyautogen`. Find more options in [Installation](/docs/installation/).
  14. For [code execution](/docs/FAQ#code-execution), we strongly recommend installing the python docker package, and using docker.
  15. #### Multi-Agent Conversation Framework
  16. Autogen enables the next-gen LLM applications with a generic multi-agent conversation framework. It offers customizable and conversable agents which integrate LLMs, tools, and humans.
  17. 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. For [example](https://github.com/microsoft/autogen/blob/main/test/twoagent.py),
  18. ```python
  19. from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
  20. # Load LLM inference endpoints from an env variable or a file
  21. # See https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
  22. # and OAI_CONFIG_LIST_sample.json
  23. config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
  24. assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
  25. user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommended
  26. user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
  27. # This initiates an automated chat between the two agents to solve the task
  28. ```
  29. The figure below shows an example conversation flow with AutoGen.
  30. ![Agent Chat Example](/img/chat_example.png)
  31. * [Code examples](/docs/Examples).
  32. * [Documentation](/docs/Use-Cases/agent_chat).
  33. #### Enhanced LLM Inferences
  34. 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 tuning, caching, error handling, templating. For example, you can optimize generations by LLM with your own tuning data, success metrics and budgets.
  35. ```python
  36. # perform tuning for openai<1
  37. config, analysis = autogen.Completion.tune(
  38. data=tune_data,
  39. metric="success",
  40. mode="max",
  41. eval_func=eval_func,
  42. inference_budget=0.05,
  43. optimization_budget=3,
  44. num_samples=-1,
  45. )
  46. # perform inference for a test instance
  47. response = autogen.Completion.create(context=test_instance, **config)
  48. ```
  49. * [Code examples](/docs/Examples).
  50. * [Documentation](/docs/Use-Cases/enhanced_inference).
  51. ### Where to Go Next ?
  52. * Understand the use cases for [multi-agent conversation](/docs/Use-Cases/agent_chat) and [enhanced LLM inference](/docs/Use-Cases/enhanced_inference).
  53. * Find [code examples](/docs/Examples).
  54. * Read [SDK](/docs/reference/agentchat/conversable_agent/).
  55. * Learn about [research](/docs/Research) around AutoGen.
  56. * [Roadmap](https://github.com/orgs/microsoft/projects/989/views/3)
  57. * Chat on [Discord](https://discord.gg/pAbnFJrkgZ).
  58. * Follow on [Twitter](https://twitter.com/pyautogen).
  59. If you like our project, please give it a [star](https://github.com/microsoft/autogen/stargazers) on GitHub. If you are interested in contributing, please read [Contributor's Guide](/docs/Contribute).
  60. <iframe src="https://ghbtns.com/github-btn.html?user=microsoft&amp;repo=autogen&amp;type=star&amp;count=true&amp;size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>