-
Notifications
You must be signed in to change notification settings - Fork 521
/
openapi_schema.json
572 lines (572 loc) · 22.3 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
{
"openapi": "3.1.0",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"paths": {
"/health": {
"get": {
"summary": "Health Check",
"description": "Perform a Health Check\n\nReturns 200 when service is up. This does not check the health of downstream services.",
"operationId": "health_check_health_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HealthResponse"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"example": {
"detail": "Internal server error occurred"
}
}
}
}
}
}
},
"/documents": {
"post": {
"summary": "Upload Document",
"description": "Upload a document to the vector store.",
"operationId": "upload_document_documents_post",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/Body_upload_document_documents_post"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"example": {
"detail": "Internal server error occurred"
}
}
}
}
}
},
"get": {
"summary": "Get Documents",
"description": "List available documents.",
"operationId": "get_documents_documents_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentsResponse"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"example": {
"detail": "Internal server error occurred"
}
}
}
}
}
},
"delete": {
"summary": "Delete Document",
"description": "Delete a document.",
"operationId": "delete_document_documents_delete",
"parameters": [
{
"name": "filename",
"in": "query",
"required": true,
"schema": {
"type": "string",
"title": "Filename"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"example": {
"detail": "Internal server error occurred"
}
}
}
}
}
}
},
"/generate": {
"post": {
"summary": "Generate Answer",
"description": "Generate and stream the response to the provided prompt.",
"operationId": "generate_answer_generate_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Prompt"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChainResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"example": {
"detail": "Internal server error occurred"
}
}
}
}
}
}
},
"/search": {
"post": {
"summary": "Document Search",
"description": "Search for the most relevant documents for the given search parameters.",
"operationId": "document_search_search_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentSearch"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentSearchResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"example": {
"detail": "Internal server error occurred"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Body_upload_document_documents_post": {
"properties": {
"file": {
"type": "string",
"format": "binary",
"title": "File"
}
},
"type": "object",
"required": [
"file"
],
"title": "Body_upload_document_documents_post"
},
"ChainResponse": {
"properties": {
"id": {
"type": "string",
"maxLength": 100000,
"pattern": "[\\s\\S]*",
"title": "Id",
"default": ""
},
"choices": {
"items": {
"$ref": "#/components/schemas/ChainResponseChoices"
},
"type": "array",
"maxItems": 256,
"title": "Choices",
"default": []
}
},
"type": "object",
"title": "ChainResponse",
"description": "Definition of Chain APIs resopnse data type"
},
"ChainResponseChoices": {
"properties": {
"index": {
"type": "integer",
"maximum": 9223372036854776000,
"minimum": 0,
"format": "int64",
"title": "Index",
"default": 0
},
"message": {
"allOf": [
{
"$ref": "#/components/schemas/Message"
}
],
"default": {
"role": "assistant",
"content": ""
}
},
"finish_reason": {
"type": "string",
"maxLength": 4096,
"pattern": "[\\s\\S]*",
"title": "Finish Reason",
"default": ""
}
},
"type": "object",
"title": "ChainResponseChoices",
"description": "Definition of Chain response choices"
},
"DocumentChunk": {
"properties": {
"content": {
"type": "string",
"maxLength": 131072,
"pattern": "[\\s\\S]*",
"title": "Content",
"description": "The content of the document chunk."
},
"filename": {
"type": "string",
"maxLength": 4096,
"pattern": "[\\s\\S]*",
"title": "Filename",
"description": "The name of the file the chunk belongs to."
},
"score": {
"type": "number",
"title": "Score",
"description": "The relevance score of the chunk."
}
},
"type": "object",
"required": [
"content",
"filename",
"score"
],
"title": "DocumentChunk",
"description": "Represents a chunk of a document."
},
"DocumentSearch": {
"properties": {
"query": {
"type": "string",
"maxLength": 131072,
"pattern": "[\\s\\S]*",
"title": "Query",
"description": "The content or keywords to search for within documents."
},
"top_k": {
"type": "integer",
"maximum": 9223372036854776000,
"minimum": 0,
"format": "int64",
"title": "Top K",
"description": "The maximum number of documents to return in the response.",
"default": 4
}
},
"type": "object",
"required": [
"query"
],
"title": "DocumentSearch",
"description": "Definition of the DocumentSearch API data type."
},
"DocumentSearchResponse": {
"properties": {
"chunks": {
"items": {
"$ref": "#/components/schemas/DocumentChunk"
},
"type": "array",
"maxItems": 256,
"title": "Chunks",
"description": "List of document chunks."
}
},
"type": "object",
"required": [
"chunks"
],
"title": "DocumentSearchResponse",
"description": "Represents a response from a document search."
},
"DocumentsResponse": {
"properties": {
"documents": {
"items": {
"type": "string",
"maxLength": 131072,
"pattern": "[\\s\\S]*"
},
"type": "array",
"maxItems": 1000000,
"title": "Documents",
"description": "List of filenames."
}
},
"type": "object",
"required": [
"documents"
],
"title": "DocumentsResponse",
"description": "Represents the response containing a list of documents."
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"HealthResponse": {
"properties": {
"message": {
"type": "string",
"maxLength": 4096,
"pattern": "[\\s\\S]*",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "HealthResponse"
},
"Message": {
"properties": {
"role": {
"type": "string",
"maxLength": 256,
"pattern": "[\\s\\S]*",
"title": "Role",
"description": "Role for a message AI, User and System",
"default": "user"
},
"content": {
"type": "string",
"maxLength": 131072,
"pattern": "[\\s\\S]*",
"title": "Content",
"description": "The input query/prompt to the pipeline.",
"default": "I am going to Paris, what should I see?"
}
},
"type": "object",
"title": "Message",
"description": "Definition of the Chat Message type."
},
"Prompt": {
"properties": {
"messages": {
"items": {
"$ref": "#/components/schemas/Message"
},
"type": "array",
"maxItems": 50000,
"title": "Messages",
"description": "A list of messages comprising the conversation so far. The roles of the messages must be alternating between user and assistant. The last input message should have role user. A message with the the system role is optional, and must be the very first message if it is present."
},
"use_knowledge_base": {
"type": "boolean",
"title": "Use Knowledge Base",
"description": "Whether to use a knowledge base"
},
"temperature": {
"type": "number",
"maximum": 1,
"minimum": 0.1,
"title": "Temperature",
"description": "The sampling temperature to use for text generation. The higher the temperature value is, the less deterministic the output text will be. It is not recommended to modify both temperature and top_p in the same call.",
"default": 0.2
},
"top_p": {
"type": "number",
"maximum": 1,
"minimum": 0.1,
"title": "Top P",
"description": "The top-p sampling mass used for text generation. The top-p value determines the probability mass that is sampled at sampling time. For example, if top_p = 0.2, only the most likely tokens (summing to 0.2 cumulative probability) will be sampled. It is not recommended to modify both temperature and top_p in the same call.",
"default": 0.7
},
"max_tokens": {
"type": "integer",
"maximum": 9223372036854776000,
"minimum": 0,
"format": "int64",
"title": "Max Tokens",
"description": "The maximum number of tokens to generate in any given call. Note that the model is not aware of this value, and generation will simply stop at the number of tokens specified.",
"default": 1024
},
"stop": {
"items": {
"type": "string",
"maxLength": 256,
"pattern": "[\\s\\S]*"
},
"type": "array",
"maxItems": 256,
"title": "Stop",
"description": "A string or a list of strings where the API will stop generating further tokens. The returned text will not contain the stop sequence."
}
},
"type": "object",
"required": [
"messages",
"use_knowledge_base"
],
"title": "Prompt",
"description": "Definition of the Prompt API data type."
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
}