Spaces:
Sleeping
Sleeping
File size: 1,321 Bytes
64462d2 | 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 | # Agent Chat Web Application
A modern chat interface for interacting with the AI agent framework.
## Features
- Real-time chat with AI agent
- Session memory toggle (on/off)
- File upload support
- Display of available tools
- Tool usage indicators in responses
## Running the Application
### Option 1: Direct run
```bash
cd web_app
python app.py
```
### Option 2: With uvicorn (recommended)
```bash
uvicorn web_app.app:app --reload --host 0.0.0.0 --port 8000
```
Then open http://localhost:8000 in your browser.
## API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/` | GET | Chat interface |
| `/api/tools` | GET | List available tools |
| `/api/chat` | POST | Send message to agent |
| `/api/upload` | POST | Upload a file |
| `/api/uploads` | GET | List uploaded files |
| `/api/uploads/{filename}` | DELETE | Delete uploaded file |
| `/api/sessions` | GET | List active sessions |
| `/api/sessions/{session_id}` | DELETE | Clear a session |
## Chat Request Format
```json
{
"message": "Your message here",
"session_id": "optional-session-id",
"use_session": true
}
```
## Chat Response Format
```json
{
"response": "Agent's response",
"session_id": "session-uuid",
"events_count": 4,
"tools_used": ["calculator", "search_web"]
}
```
|