File size: 1,882 Bytes
1bc1f1d 9758a71 1bc1f1d 9758a71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ---
title: AI Agent POC
emoji: 🧮
colorFrom: blue
colorTo: purple
sdk: docker
sdk_version: latest
app_file: app.py
pinned: false
---
# AI Agent POC
A friendly Math Tutor AI agent built with Chainlit and LangChain, powered by Anthropic's Claude.
## Features
- Interactive chat interface using Chainlit
- Math tutoring for elementary school students
- Streaming responses for real-time interaction
- Powered by Claude 3.5 Sonnet
## Setup
### Local Development
1. **Create and activate a virtual environment:**
**Windows (PowerShell):**
```powershell
python -m venv venv
.\venv\Scripts\Activate.ps1
```
**Windows (CMD):**
```cmd
python -m venv venv
venv\Scripts\activate.bat
```
**Linux/Mac:**
```bash
python -m venv venv
source venv/bin/activate
```
2. **Install dependencies:**
```bash
pip install -r requirements.txt
```
3. **Set up your API key:**
Create a `.env` file in the project root:
```bash
ANTHROPIC_API_KEY=your_api_key_here
```
Or set it as an environment variable:
- **Windows (PowerShell):**
```powershell
$env:ANTHROPIC_API_KEY="your_api_key_here"
```
- **Windows (CMD):**
```cmd
set ANTHROPIC_API_KEY=your_api_key_here
```
- **Linux/Mac:**
```bash
export ANTHROPIC_API_KEY=your_api_key_here
```
4. **Run the application:**
```bash
chainlit run app.py
```
The app will start on `http://localhost:8000` by default.
5. **Access the chat interface:**
- Open your browser and navigate to `http://localhost:8000`
- Start chatting with the AI agent!
### Hugging Face Spaces Deployment
1. Set your `ANTHROPIC_API_KEY` in the Space secrets
2. The app will automatically deploy when code is pushed
## Usage
Simply start chatting! The AI agent will guide you through the Design Thinking process.
|