Vitrous commited on
Commit
8438652
·
verified ·
1 Parent(s): 3dd23da

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +94 -57
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/api/v1/`.
38
 
39
- ## Endpoints
40
 
41
- ### `POST https://articko-artickbot.hf.space/api/v1/chat`
42
-
43
- Starts a new conversation thread with a provided user message prompt.
44
 
45
- #### Request Body
46
 
47
- ```json
48
- {
49
- "msg_prompt": "User's message prompt"
50
- }
51
- ```
52
 
53
- #### Response
54
 
55
- ```json
56
- {
57
- "thread_id": id of the conversation,
58
- "response": {
59
- "user": "User's message prompt",
60
- "assistant": "Generated response from the chatbot"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
- }
63
- ```
64
 
65
- ### `POST https://articko-artickbot.hf.space/api/v1/prompted_chat`
66
 
67
  Starts a new chat thread with a provided user message prompt and persona description of the AI assistant.
68
 
69
- #### Request Body
70
-
71
- ```json
72
- {
 
 
 
73
  "msg_prompt": "User's message prompt",
74
- "instructions_prompt": "Persona description of the AI assistant. it must be well decsribed with proper grammar and and isntructions,intensions etc of the assistant for better results"
75
- }
76
- ```
77
-
78
- #### Response
79
-
80
- ```json
81
- {
82
- "thread_id": "ID of the conversation thread",
83
- "response": {
84
- "user": "User's message prompt",
85
- "assistant": "Generated response from the chatbot"
 
 
 
 
 
 
86
  }
87
- }
88
- ```
89
-
90
- ### `GET https://articko-artickbot.hf.space/api/v1/get_response/{thread_id}`
91
-
92
- Retrieves the response of a conversation thread by its ID.
 
 
 
 
 
 
 
93
 
94
- #### Path Parameters
95
 
96
- - `thread_id`: ID of the conversation thread
97
 
98
- #### Response
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
+ ---