Artix / README.md
Vitrous's picture
Update README.md
3a787cf verified
|
raw
history blame
2.12 kB
---
title: ArtickBot
emoji: 🔥
colorFrom: yellow
colorTo: red
sdk: docker
pinned: false
license: mit
app_port: 7860
---
```markdown
```
# ArtickBot
- AI chatbot built using FastAPI and Hugging Face's transformers library. It allows users to initiate conversations with the bot and receive responses based on predefined persona templates.
```
```
## Usage
1. Run the FastAPI server:
- The application runs from a Dockerfile where everything is setup for you
2. Open your web browser and go to https://articko-artickbot.hf.space/api/v1/ to access the API documentation provided by FastAPI.
## Use the provided endpoints to interact with the chatbot:
3.
- `/start_chat/`: Start a new chat thread by providing a prompt and a persona description prompt i.e
- Expects a POST Request with a JSON Body
```json
{"prompt":"what food would you recommend",
"persona_prompt":"you are a very helpful ai assistant. you are going to be polite and answer a humanily."}
```
- `This method returns {'thread_id': thread_id, 'response': response}
- `/start_conversation/`: Start a new conversation thread by providing a prompt.
- Expects a POST Request with a JSON Body
```json
{"prompt":"what is the time"}
```
- `After the request is done, this function returns {'response': response}
- `/get_response/{thread_id}`: Retrieve the response from an existing conversation thread using its thread ID.
- Expects a GET Request with the {thread id} of the conversation
- `Returns the specific thread id of the conversation
## Example
```python
import requests
# Start a new chat session
response = requests.post("https://articko-artickbot.hf.space/api/v1/start_conversation", json={"prompt": "Hello, how are you?"})
print(response.json())
```
---
This README provides an overview of the project, installation instructions, usage guidelines, and an example of how to interact with the chatbot using the provided endpoints. Feel free to customize it further to suit your project's needs.
```