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.

README.md 2.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Building a Multi-Agent Application with AutoGen and Chainlit
  2. In this sample, we will demonstrate how to build simple chat interface that
  3. interacts with an [AgentChat](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html)
  4. agent or a team, using [Chainlit](https://github.com/Chainlit/chainlit),
  5. and support streaming messages.
  6. ![AgentChat](docs/chainlit_autogen.png).
  7. ## Installation
  8. To run this sample, you will need to install the following packages:
  9. ```shell
  10. pip install -U chainlit autogen-agentchat autogen-ext[openai] pyyaml
  11. ```
  12. To use other model providers, you will need to install a different extra
  13. for the `autogen-ext` package.
  14. See the [Models documentation](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/models.html) for more information.
  15. ## Model Configuration
  16. Create a configuration file named `model_config.yaml` to configure the model
  17. you want to use. Use `model_config_template.yaml` as a template.
  18. ## Running the Agent Sample
  19. The first sample demonstrate how to interact with a single AssistantAgent
  20. from the chat interface.
  21. ```shell
  22. chainlit run app_agent.py -h
  23. ```
  24. You can use one of the starters. For example, ask "What the weather in Seattle?".
  25. The agent will respond by first using the tools provided and then reflecting
  26. on the result of the tool execution.
  27. ## Running the Team Sample
  28. The second sample demonstrate how to interact with a team of agents from the
  29. chat interface.
  30. ```shell
  31. chainlit run app_team.py -h
  32. ```
  33. You can use one of the starters. For example, ask "Write a poem about winter.".
  34. The team is a RoundRobinGroupChat, so each agent will respond in turn.
  35. There are two agents in the team: one is instructed to be generally helpful
  36. and the other one is instructed to be a critic and provide feedback.
  37. The two agents will respond in round-robin fashion until
  38. the 'APPROVE' is mentioned by the critic agent.
  39. ## Next Steps
  40. There are a few ways you can extend this example:
  41. - Try other [agents](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/agents.html).
  42. - Try other [team](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/teams.html) types beyond the `RoundRobinGroupChat`.
  43. - Explore custom agents that sent multimodal messages.