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"}` |