Vitrous commited on
Commit
2a47b1a
·
verified ·
1 Parent(s): 92d318e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -41
README.md CHANGED
@@ -8,49 +8,111 @@ pinned: false
8
  license: mit
9
  app_port: 7860
10
  ---
 
 
 
 
 
 
 
 
 
 
11
 
12
- # ArtickBot
13
- - 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.
14
  ## Usage
15
- 1. Run the FastAPI server:
16
-
17
- - The application runs from a Dockerfile where everything is setup for you
18
-
19
- 2. Open your web browser and go to https://articko-artickbot.hf.space/api/v1/ to access the API documentation provided by FastAPI.
20
-
21
- ## Use the provided endpoints to interact with the chatbot:
22
-
23
- 3.
24
- - `/start_chat/`: Start a new chat thread by providing a prompt and a persona description prompt i.e
25
- - Expects a POST Request with a JSON Body
26
-
27
- ```json
28
- {"prompt":"what food would you recommend",
29
- "persona_prompt":"you are a very helpful ai assistant. you are going to be polite and answer a humanily."}
30
- ```
31
- - `This method returns {'thread_id': thread_id, 'response': response}
32
-
33
- - `/start_conversation/`: Start a new conversation thread by providing a prompt.
34
- - Expects a POST Request with a JSON Body
35
- ```json
36
- {"prompt":"what is the time"}
37
- ```
38
- - `After the request is done, this function returns {'response': response}
39
-
40
- - `/get_response/{thread_id}`: Retrieve the response from an existing conversation thread using its thread ID.
41
- - Expects a GET Request with the {thread id} of the conversation
42
-
43
- - `Returns the specific thread id of the conversation
44
-
45
- ## Example
46
-
47
- ```python
48
- import requests
49
-
50
- # Start a new chat session
51
- response = requests.post("https://articko-artickbot.hf.space/api/v1/start_conversation", json={"prompt": "Hello, how are you?"})
52
- print(response.json())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  ```
 
 
 
 
 
 
 
 
 
 
 
54
  ---
55
 
56
- 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.
 
8
  license: mit
9
  app_port: 7860
10
  ---
11
+ ---
12
+
13
+ # ArtickoBOt
14
+
15
+ 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.
16
+
17
+ ## Requirements
18
+
19
+ - Docker
20
+ - Hugging Face Spaces
21
 
 
 
22
  ## Usage
23
+
24
+ ### Building the Docker Image
25
+
26
+ - The application has a Dockerfile that will run automatic and install as well as build the dependencies
27
+
28
+ ### Running the Docker Container
29
+
30
+ - The Dockerfile is configured to start uvicorn servers at port: 7860
31
+ - The uvicorn can be configured to use multiple workers to process/serve data
32
+
33
+ ### Accessing the API
34
+
35
+ You can access the API endpoints using a web browser or an HTTP client at `https://articko-artickbot.hf.space/api/v1/`.
36
+
37
+ ## Endpoints
38
+
39
+ ### `POST https://articko-artickbot.hf.space/api/v1/chat`
40
+
41
+ Starts a new conversation thread with a provided user message prompt.
42
+
43
+ #### Request Body
44
+
45
+ ```json
46
+ {
47
+ "msg_prompt": "User's message prompt"
48
+ }
49
+ ```
50
+
51
+ #### Response
52
+
53
+ ```json
54
+ {
55
+ "response": {
56
+ "user": "User's message prompt",
57
+ "assistant": "Generated response from the chatbot"
58
+ }
59
+ }
60
+ ```
61
+
62
+ ### `POST https://articko-artickbot.hf.space/api/v1/prompted_chat`
63
+
64
+ Starts a new chat thread with a provided user message prompt and persona description of the AI assistant.
65
+
66
+ #### Request Body
67
+
68
+ ```json
69
+ {
70
+ "msg_prompt": "User's message prompt",
71
+ "persona_desc": "Persona description of the AI assistant"
72
+ }
73
+ ```
74
+
75
+ #### Response
76
+
77
+ ```json
78
+ {
79
+ "thread_id": "ID of the conversation thread",
80
+ "response": {
81
+ "user": "User's message prompt",
82
+ "assistant": "Generated response from the chatbot"
83
+ }
84
+ }
85
+ ```
86
+
87
+ ### `GET https://articko-artickbot.hf.space/api/v1/get_response/{thread_id}`
88
+
89
+ Retrieves the response of a conversation thread by its ID.
90
+
91
+ #### Path Parameters
92
+
93
+ - `thread_id`: ID of the conversation thread
94
+
95
+ #### Response
96
+
97
+ ```json
98
+ {
99
+ "response": {
100
+ "user": "User's message prompt",
101
+ "assistant": "Generated response from the chatbot"
102
+ }
103
+ }
104
  ```
105
+
106
+ For more details on each endpoint, refer to the docstrings within the source code.
107
+
108
+ ## Contributing
109
+
110
+ Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
111
+
112
+ ## License
113
+
114
+ This project is licensed under the [MIT License](LICENSE).
115
+
116
  ---
117
 
118
+ 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!