File size: 863 Bytes
c23e128
bf5275b
 
c23e128
 
 
bf5275b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c23e128
bf5275b
 
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
---
title: huggingface-small-agent-test
app_file: app.py
sdk: gradio
sdk_version: 5.34.2
---
# HuggingFace Smol-Agent Chatbot

A simple chatbot implementation using HuggingFace's smol-agent.

## Setup

1. Clone this repository
2. Create a `.env` file based on `.env.example`:
   ```bash
   cp .env.example .env
   ```
3. Add your HuggingFace API token to the `.env` file

## Usage

### Install dependencies

```bash
uv pip install .
```

### Run the CLI chatbot

```bash
python chatbot.py
```

### Run the API server

```bash
python api.py
```

The API will be available at http://localhost:8000

## API Endpoints

- **POST /chat**: Send a message to the chatbot
  - Request: `{"message": "Hello, how are you?"}`
  - Response: `{"response": "I'm doing well, thank you for asking!"}`

- **GET /health**: Check if the API is running
  - Response: `{"status": "ok"}`