https://github.com/timvw/chatbot-api
Demo API for a Chatbot with Rust
https://github.com/timvw/chatbot-api
Last synced: 3 months ago
JSON representation
Demo API for a Chatbot with Rust
- Host: GitHub
- URL: https://github.com/timvw/chatbot-api
- Owner: timvw
- License: mit
- Created: 2024-08-19T08:47:47.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-20T07:24:31.000Z (3 months ago)
- Last Synced: 2025-02-20T08:27:27.647Z (3 months ago)
- Language: Rust
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chatbot-API
A demo application exposing a chatbot API build with Rust ([axum](https://github.com/tokio-rs/axum) + friends)
## Configuration
Create a dotenvs/openai.env file with the following keys:
```text
OPENAI_API_KEY="sk-xxxx"
```Create a dotenvs/jaeger.env file with the following keys:
```text
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://yourhost:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_TRACES_SAMPLER=always_on
OTEL_SERVICE_NAME=chatapi
```## Development
```bash
cargo watch -q -c -w src/ -x run
``````bash
curl -i http://localhost:3000/threads
``````bash
curl -X POST -H "Content-type: application/json" -i -vvv http://localhost:3000/threads -d ''
``````bash
curl -i http://localhost:3000/threads/67e55044-10b1-426f-9247-bb680e5fe0c8/messages
``````bash
curl -X POST -H "Content-type: application/json" -i http://localhost:3000/threads/67e55044-10b1-426f-9247-bb680e5fe0c8/messages -d '{"content": "awesome"}'
```