|
--- |
|
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. |
|
|
|
## 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/api/v1/`. |
|
|
|
## Endpoints |
|
|
|
### `POST https://articko-artickbot.hf.space/api/v1/chat` |
|
|
|
Starts a new conversation thread with a provided user message prompt. |
|
|
|
#### Request Body |
|
|
|
```json |
|
{ |
|
"msg_prompt": "User's message prompt" |
|
} |
|
``` |
|
|
|
#### Response |
|
|
|
```json |
|
{ |
|
"response": { |
|
"user": "User's message prompt", |
|
"assistant": "Generated response from the chatbot" |
|
} |
|
} |
|
``` |
|
|
|
### `POST https://articko-artickbot.hf.space/api/v1/prompted_chat` |
|
|
|
Starts a new chat thread with a provided user message prompt and persona description of the AI assistant. |
|
|
|
#### Request Body |
|
|
|
```json |
|
{ |
|
"msg_prompt": "User's message prompt", |
|
"persona_desc": "Persona description of the AI assistant" |
|
} |
|
``` |
|
|
|
#### Response |
|
|
|
```json |
|
{ |
|
"thread_id": "ID of the conversation thread", |
|
"response": { |
|
"user": "User's message prompt", |
|
"assistant": "Generated response from the chatbot" |
|
} |
|
} |
|
``` |
|
|
|
### `GET https://articko-artickbot.hf.space/api/v1/get_response/{thread_id}` |
|
|
|
Retrieves the response of a conversation thread by its ID. |
|
|
|
#### Path Parameters |
|
|
|
- `thread_id`: ID of the conversation thread |
|
|
|
#### Response |
|
|
|
```json |
|
{ |
|
"response": { |
|
"user": "User's message prompt", |
|
"assistant": "Generated response from the chatbot" |
|
} |
|
} |
|
``` |
|
|
|
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). |
|
|
|
--- |
|
|
|
Feel free to customize this README file further to include additional information specific to your project or environment. If you have any questions or need further assistance, don't hesitate to ask! |