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. # Core ChainLit Integration Sample
  2. In this sample, we will demonstrate how to build simple chat interface that
  3. interacts with a [Core](https://microsoft.github.io/autogen/stable/user-guide/core-user-guide/index.html)
  4. agent or a team, using [Chainlit](https://github.com/Chainlit/chainlit),
  5. and support streaming messages.
  6. ## Overview
  7. The `core_chainlit` sample is designed to illustrate a simple use case of ChainLit integrated with a single-threaded agent runtime. It includes the following components:
  8. - **Single Agent**: A single agent that operates within the ChainLit environment.
  9. - **Group Chat**: A group chat setup featuring two agents:
  10. - **Assistant Agent**: This agent responds to user inputs.
  11. - **Critic Agent**: This agent reflects on and critiques the responses from the Assistant Agent.
  12. - **Closure Agent**: Utilizes a closure agent to aggregate output messages into an output queue.
  13. - **Token Streaming**: Demonstrates how to stream tokens to the user interface.
  14. - **Session Management**: Manages the runtime and output queue within the ChainLit user session.
  15. ## Requirements
  16. To run this sample, you will need:
  17. - Python 3.8 or higher
  18. - Installation of necessary Python packages as listed in `requirements.txt`
  19. ## Installation
  20. To run this sample, you will need to install the following packages:
  21. ```shell
  22. pip install -U chainlit autogen-core autogen-ext[openai] pyyaml
  23. ```
  24. To use other model providers, you will need to install a different extra
  25. for the `autogen-ext` package.
  26. See the [Models documentation](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/models.html) for more information.
  27. ## Model Configuration
  28. Create a configuration file named `model_config.yaml` to configure the model
  29. you want to use. Use `model_config_template.yaml` as a template.
  30. ## Running the Agent Sample
  31. The first sample demonstrate how to interact with a single AssistantAgent
  32. from the chat interface.
  33. Note: cd to the sample directory.
  34. ```shell
  35. chainlit run app_agent.py
  36. ```
  37. ## Running the Team Sample
  38. The second sample demonstrate how to interact with a team of agents from the
  39. chat interface.
  40. ```shell
  41. chainlit run app_team.py -h
  42. ```
  43. There are two agents in the team: one is instructed to be generally helpful
  44. and the other one is instructed to be a critic and provide feedback.