Update README.md
Browse files
README.md
CHANGED
@@ -16,6 +16,13 @@ This project implements a chatbot using FastAPI and a pre-trained language model
|
|
16 |
|
17 |
All api docs can be found here https://articko-artickbot.hf.space/api/v1/docs#/
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
## Requirements
|
20 |
|
21 |
- Docker
|
@@ -34,77 +41,109 @@ All api docs can be found here https://articko-artickbot.hf.space/api/v1/docs#/
|
|
34 |
|
35 |
### Accessing the API
|
36 |
|
37 |
-
You can access the API endpoints using a web browser or an HTTP client at `https://articko-artickbot.hf.space
|
38 |
|
39 |
-
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
Starts a new conversation thread with a provided user message prompt.
|
44 |
|
45 |
-
|
46 |
|
47 |
-
|
48 |
-
{
|
49 |
-
"msg_prompt": "User's message prompt"
|
50 |
-
}
|
51 |
-
```
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
-
|
63 |
-
```
|
64 |
|
65 |
-
###
|
66 |
|
67 |
Starts a new chat thread with a provided user message prompt and persona description of the AI assistant.
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
73 |
"msg_prompt": "User's message prompt",
|
74 |
-
"
|
75 |
-
}
|
76 |
-
```
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
{
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
-
|
95 |
|
96 |
-
|
97 |
|
98 |
-
|
99 |
|
100 |
-
```json
|
101 |
-
{
|
102 |
-
"response": {
|
103 |
-
"user": "User's message prompt",
|
104 |
-
"assistant": "Generated response from the chatbot"
|
105 |
-
}
|
106 |
-
}
|
107 |
-
```
|
108 |
|
109 |
For more details on each endpoint, refer to the docstrings within the source code.
|
110 |
|
@@ -116,6 +155,4 @@ Contributions are welcome! If you find any issues or have suggestions for improv
|
|
116 |
|
117 |
This project is licensed under the [MIT License](LICENSE).
|
118 |
|
119 |
-
---
|
120 |
-
|
121 |
-
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!
|
|
|
16 |
|
17 |
All api docs can be found here https://articko-artickbot.hf.space/api/v1/docs#/
|
18 |
|
19 |
+
## Table of Contents
|
20 |
+
|
21 |
+
- [Overview](#overview)
|
22 |
+
- [Endpoints](#endpoints)
|
23 |
+
- [/thread/{user_id}](#threaduser_id)
|
24 |
+
- [/chat_thread/{user_id}](#chat_threaduser_id)
|
25 |
+
|
26 |
## Requirements
|
27 |
|
28 |
- Docker
|
|
|
41 |
|
42 |
### Accessing the API
|
43 |
|
44 |
+
You can access the API endpoints using a web browser or an HTTP client at `https://articko-artickbot.hf.space/`.
|
45 |
|
46 |
+
Sure, here's a revised version of the README.md file:
|
47 |
|
48 |
+
---
|
|
|
|
|
49 |
|
50 |
+
## Endpoints
|
51 |
|
52 |
+
### /thread/{user_id}
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
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}
|
55 |
|
56 |
+
- **Method**: `POST`
|
57 |
+
- **Parameters**:
|
58 |
+
- `user_id` (str): The unique identifier for the user.
|
59 |
+
- **Request Body**:
|
60 |
+
```json
|
61 |
+
{
|
62 |
+
"msg_prompt": "User's message prompt",
|
63 |
+
"msg_history": "Previous chat history (optional)"
|
64 |
+
}
|
65 |
+
```
|
66 |
+
- **Responses**:
|
67 |
+
- `200 OK`: Successfully started a new conversation thread.
|
68 |
+
```json
|
69 |
+
{
|
70 |
+
"response": {
|
71 |
+
"user_id": "user_id",
|
72 |
+
"thread": {
|
73 |
+
"thread_id": "unique_thread_id",
|
74 |
+
"message_id": "unique_message_id",
|
75 |
+
"message": {
|
76 |
+
"user": "User's message prompt",
|
77 |
+
"assistant": "Model's response"
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
```
|
83 |
+
- `400 Bad Request`: If the prompt is not provided.
|
84 |
+
```json
|
85 |
+
{
|
86 |
+
"detail": "Prompt not provided"
|
87 |
+
}
|
88 |
+
```
|
89 |
+
- `500 Internal Server Error`: If an unexpected error occurs.
|
90 |
+
```json
|
91 |
+
{
|
92 |
+
"detail": "Internal Server Error"
|
93 |
}
|
94 |
+
```
|
|
|
95 |
|
96 |
+
### /chat_thread/{user_id}
|
97 |
|
98 |
Starts a new chat thread with a provided user message prompt and persona description of the AI assistant.
|
99 |
|
100 |
+
- **Method**: `POST`
|
101 |
+
- **Parameters**:
|
102 |
+
- `user_id` (str): The unique identifier for the user.
|
103 |
+
- **Request Body**:
|
104 |
+
```json
|
105 |
+
{
|
106 |
+
"ai_persona": "AI assistant's persona description",
|
107 |
"msg_prompt": "User's message prompt",
|
108 |
+
"msg_history": "Previous chat history (optional)"
|
109 |
+
}
|
110 |
+
```
|
111 |
+
- **Responses**:
|
112 |
+
- `200 OK`: Successfully started a new chat thread.
|
113 |
+
```json
|
114 |
+
{
|
115 |
+
"response": {
|
116 |
+
"user_id": "user_id",
|
117 |
+
"thread": {
|
118 |
+
"thread_id": "unique_thread_id",
|
119 |
+
"message_id": "unique_message_id",
|
120 |
+
"message": {
|
121 |
+
"user": "User's message prompt",
|
122 |
+
"assistant": "Model's response"
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
}
|
127 |
+
```
|
128 |
+
- `400 Bad Request`: If the prompt is not provided.
|
129 |
+
```json
|
130 |
+
{
|
131 |
+
"detail": "Prompt not provided"
|
132 |
+
}
|
133 |
+
```
|
134 |
+
- `500 Internal Server Error`: If an unexpected error occurs.
|
135 |
+
```json
|
136 |
+
{
|
137 |
+
"detail": "Internal Server Error"
|
138 |
+
}
|
139 |
+
```
|
140 |
|
141 |
+
This README provides an overview of Articko Bot and detailed information about its endpoints, including request bodies and responses.
|
142 |
|
143 |
+
---
|
144 |
|
145 |
+
This should give users a clear understanding of how to interact with the API and what to expect in terms of responses.
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
For more details on each endpoint, refer to the docstrings within the source code.
|
149 |
|
|
|
155 |
|
156 |
This project is licensed under the [MIT License](LICENSE).
|
157 |
|
158 |
+
---
|
|
|
|