Artix / README.md
Vitrous's picture
Update README.md
c3dd796 verified
|
raw
history blame
4.17 kB
---
title: ArtickBot
emoji: 🚀
colorFrom: yellow
colorTo: red
sdk: docker
pinned: false
license: mit
app_port: 7860
---
---
# ArtickoBot
This project implements a chatbot using FastAPI and a pre-trained language model. The chatbot can generate responses based on user prompts and persona descriptions.
All api docs can be found here https://articko-artickbot.hf.space/docs#/
## Table of Contents
- [Overview](#overview)
- [Endpoints](#endpoints)
- [/thread/{user_id}](#threaduser_id)
- [/chat_thread/{user_id}](#chat_threaduser_id)
## Requirements
- Docker
- Hugging Face Spaces
## Usage
### Building the Docker Image
- The application has a Dockerfile that will run automatic and install as well as build the dependencies
### Running the Docker Container
- The Dockerfile is configured to start uvicorn servers at port: 7860
- The uvicorn can be configured to use multiple workers to process/serve data
### Accessing the API
You can access the API endpoints using a web browser or an HTTP client at `https://articko-artickbot.hf.space/`.
The API endpoints can also be accessed from Localhost using a web browser or an HTTP client at `https://127.0.0.1:7860/`.
If your machine is using proxy servers make sure that the host address of the proxy server is set to host: `127.0.0.1` at Port: `7860` otherwise the requests will be denied
---
## Endpoints
### /thread/{user_id}
Starts a new conversation thread with a provided prompt for a specific user. Remember this uses the ai persona written inside the code, for custom ai persona use endpoint /chat_thread/{user_id}
- **Method**: `POST`
- **Parameters**:
- `user_id` (str): The unique identifier for the user.
- **Request Body**:
```json
{
"msg_prompt": "User's message prompt",
"msg_history": "Previous chat history (optional)"
}
```
- **Responses**:
- `200 OK`: Successfully started a new conversation thread.
```json
{
"response": {
"user_id": "user_id",
"thread": {
"thread_id": "unique_thread_id",
"message_id": "unique_message_id",
"message": {
"user": "User's message prompt",
"assistant": "Model's response"
}
}
}
}
```
- `400 Bad Request`: If the prompt is not provided.
```json
{
"detail": "Prompt not provided"
}
```
- `500 Internal Server Error`: If an unexpected error occurs.
```json
{
"detail": "Internal Server Error"
}
```
### /chat_thread/{user_id}
Starts a new chat thread with a provided user message prompt and persona description of the AI assistant.
- **Method**: `POST`
- **Parameters**:
- `user_id` (str): The unique identifier for the user.
- **Request Body**:
```json
{
"ai_persona": "AI assistant's persona description",
"msg_prompt": "User's message prompt",
"msg_history": "Previous chat history (optional)"
}
```
- **Responses**:
- `200 OK`: Successfully started a new chat thread.
```json
{
"response": {
"user_id": "user_id",
"thread": {
"thread_id": "unique_thread_id",
"message_id": "unique_message_id",
"message": {
"user": "User's message prompt",
"assistant": "Model's response"
}
}
}
}
```
- `400 Bad Request`: If the prompt is not provided.
```json
{
"detail": "Prompt not provided"
}
```
- `500 Internal Server Error`: If an unexpected error occurs.
```json
{
"detail": "Internal Server Error"
}
```
This README provides an overview of Articko Bot and detailed information about its endpoints, including request bodies and responses.
---
This should give users a clear understanding of how to interact with the API and what to expect in terms of responses.
For more details on each endpoint, refer to the docstrings within the source code.
## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
## License
This project is licensed under the [MIT License](LICENSE).
---