-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from awslabs/improve-doc-with-code-samples
refatoring docs & add cookbook section
- Loading branch information
Showing
24 changed files
with
755 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
63 changes: 63 additions & 0 deletions
63
docs/src/content/docs/cookbook/examples/chat-chainlit-app.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: Chat Chainlit App with Multi-Agent Orchestrator | ||
description: How to set up a Chainlit App using Multi-Agent Orchestrator | ||
--- | ||
|
||
This example demonstrates how to build a chat application using Chainlit and the Multi-Agent Orchestrator. It showcases a system with three specialized agents (Tech, Travel, and Health) working together through a streaming-enabled chat interface. | ||
|
||
## Key Features | ||
- Streaming responses using Chainlit's real-time capabilities | ||
- Integration with multiple agent types (Bedrock and Ollama) | ||
- Custom classifier configuration using Claude 3 Haiku | ||
- Session management for user interactions | ||
- Complete chat history handling | ||
|
||
## Quick Start | ||
```bash | ||
# Clone the repository | ||
git clone https://github.com/awslabs/multi-agent-orchestrator.git | ||
cd multi-agent-orchestrator/examples/chat-chainlit-app | ||
|
||
# Install dependencies | ||
pip install -r requirements.txt | ||
|
||
# Run the application | ||
python app.py | ||
``` | ||
|
||
## Implementation Details | ||
|
||
### Components | ||
1. **Main Application** (`app.py`) | ||
- Orchestrator setup with custom Bedrock classifier | ||
- Chainlit event handlers for chat management | ||
- Streaming response handling | ||
|
||
2. **Agent Configuration** (`agents.py`) | ||
- Tech Agent: Uses Claude 3 Sonnet via Bedrock | ||
- Travel Agent: Uses Claude 3 Sonnet via Bedrock | ||
- Health Agent: Uses Ollama with Llama 3.1 | ||
|
||
3. **Custom Integration** (`ollamaAgent.py`) | ||
- Custom implementation for Ollama integration | ||
- Streaming support for real-time responses | ||
|
||
## Usage Notes | ||
- The application creates unique user and session IDs for each chat session | ||
- Responses are streamed in real-time using Chainlit's streaming capabilities | ||
- The system automatically routes queries to the most appropriate agent | ||
- Complete chat history is maintained throughout the session | ||
|
||
## Example Interaction | ||
```plaintext | ||
User: "What are the latest trends in AI?" | ||
→ Routed to Tech Agent | ||
User: "Plan a trip to Paris" | ||
→ Routed to Travel Agent | ||
User: "Recommend a workout routine" | ||
→ Routed to Health Agent | ||
``` | ||
|
||
Ready to build your own multi-agent chat application? Check out the complete [source code]() in our GitHub repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.