-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopenapi-schema.json
237 lines (237 loc) · 7.28 KB
/
openapi-schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
{
"openapi": "3.0.0",
"info": {
"title": "Chat Summarizing Automation API",
"version": "1.0.0",
"description": "APIs for chat assistance: getting messages from indicated Telegram chat, translating to English (if needed), and summarizing them. Includes the possibility to query the chat with a custom question."
},
"paths": {
"/pull-messages": {
"get": {
"summary": "Pull messages from the indicated chat",
"description": "Pull messages from the chat based on the provided chat name.",
"operationId": "pullMessages",
"parameters": [
{
"name": "chatName",
"in": "query",
"description": "Name of the chat",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Pulled messages",
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "Text of the pulled messages"
}
}
}
}
}
}
},
"/detect-language": {
"post": {
"summary": "Detect the language of the text",
"description": "Detect the language of the given block of messages. The API takes in text of messages and returns their language code.",
"operationId": "detectLanguage",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "string",
"description": "Messages text the language of which will be detected"
}
},
"required": [
"messages"
]
}
}
}
},
"responses": {
"200": {
"description": "Language detection successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"summary": {
"type": "string",
"description": "Language code of the detected language"
}
}
}
}
}
},
"400": {
"description": "Bad request. One or more required fields are missing or invalid."
}
}
}
},
"/translate": {
"post": {
"summary": "Translate Messages",
"description": "Translate a given block of messages. The API takes in messages written in a language other than English and the source language code. It translates messages into English.",
"operationId": "translateMessages",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "string",
"description": "Text of the messages to be translated"
},
"sourceLanguage": {
"type": "string",
"description": "Source language code"
}
},
"required": [
"messages", "sourceLanguage"
]
}
}
}
},
"responses": {
"200": {
"description": "Translation successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"summary": {
"type": "string",
"description": "Summary text of the messages"
}
}
}
}
}
},
"400": {
"description": "Bad request. One or more required fields are missing or invalid."
}
}
}
},
"/summarize": {
"post": {
"summary": "Summarize Messages",
"description": "Summarize a given block of messages. The API takes in text of messages written in English, and provides a summarization output and/or action points.",
"operationId": "summarizeMessages",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "string",
"description": "Text of the messages to be summarized"
}
},
"required": [
"messages"
]
}
}
}
},
"responses": {
"200": {
"description": "Summarization successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"summary": {
"type": "string",
"description": "Summary text of the messages"
}
}
}
}
}
},
"400": {
"description": "Bad request. One or more required fields are missing or invalid."
}
}
}
},
"/query-chat": {
"post": {
"summary": "Query the chat",
"description": "Query the chat based on a custom prompt question. The API takes in text of messages written in English, and the custom prompt (question). It provides an answer based on the chat context.",
"operationId": "queryChat",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "string",
"description": "Text of the messages for the context"
},
"customPrompt": {
"type": "string",
"description": "Custom question"
}
},
"required": [
"messages", "customPrompt"
]
}
}
}
},
"responses": {
"200": {
"description": "Chat querying successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"summary": {
"type": "string",
"description": "A chat-based answer to the custom prompt"
}
}
}
}
}
},
"400": {
"description": "Bad request. One or more required fields are missing or invalid."
}
}
}
}
}
}