-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathopenapi.yml
693 lines (684 loc) · 20.7 KB
/
openapi.yml
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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
---
openapi: 3.0.3
info:
title: router API
version: 1.0.0-SNAPSHOT
tags:
- name: Assistant
description: Assistant APIs
- name: Assistant Admin
description: APIs to manage Assistants
- name: Assistant Multipart
description: Assistant APIs that allow multipart file uploads
- name: Content Retriever Connection Admin
description: APIs to manage Content Retriever connections
- name: LLM Connection Admin
description: APIs to manage LLM connections
# security:
# - OIDC: [ ]
paths:
/admin/assistant:
get:
operationId: list-assistants
summary: List Assistants
tags:
- Assistant Admin
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
nullable: false
items:
$ref: '#/components/schemas/Assistant'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
post:
# TODO: POST is typically for create, where PUT or PATCH are for update... why are these concepts grouped?
operationId: create-or-update-assistant
summary: Create/Update Assistant
tags:
- Assistant Admin
requestBody:
required: true
content:
application/json:
schema:
title: CreateAssistantRequest
type: object
required:
- name
- llmConnectionId
properties:
id:
$ref: '#/components/schemas/AssistantId'
name:
type: string
displayName:
type: string
description:
type: string
userPrompt:
type: string
exampleQuestions:
type: array
items:
type: string
llmConnectionId:
$ref: '#/components/schemas/LLMConnectionId'
retrieverConnectionId:
$ref: '#/components/schemas/RetrieverConnectionId'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Assistant'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
/admin/assistant/{assistantObjectIdHexString}:
parameters:
- name: assistantObjectIdHexString
in: path
required: true
allowEmptyValue: false
schema:
$ref: '#/components/schemas/AssistantId'
get:
operationId: get-assistant
summary: Get Assistant
tags:
- Assistant Admin
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Assistant'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
delete:
operationId: delete-assistant
summary: Delete Assistant
tags:
- Assistant Admin
responses:
'200':
$ref: '#/components/responses/CommonDeleteResponse'
'400':
$ref: '#/components/responses/CommonDeleteResponse'
'401':
$ref: '#/components/responses/CommonDeleteResponse'
'403':
$ref: '#/components/responses/CommonDeleteResponse'
'500':
$ref: '#/components/responses/CommonDeleteResponse'
/admin/assistant/llm:
get:
operationId: list-llm-connections
summary: List LLM Connections
tags:
- LLM Connection Admin
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
nullable: false
items:
$ref: '#/components/schemas/LLMConnection'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
post:
# TODO: POST is typically for create, where PUT or PATCH are for update... why are these concepts grouped?
operationId: create-or-update-llm-connection
summary: Create/Update LLM Connection
tags:
- LLM Connection Admin
requestBody:
required: true
content:
application/json:
schema:
title: CreateLlmConnectionRequest
type: object
properties:
id:
$ref: '#/components/schemas/LLMConnectionId'
name:
type: string
description:
type: string
modelType:
type: string
servingRuntimeType:
type: string
url:
type: string
apiKey:
type: string
modelName:
type: string
temperature:
type: number
format: double
maxTokens:
type: integer
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/LLMConnection'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
/admin/assistant/llm/{llmConnectionObjectIdHexString}:
parameters:
- name: llmConnectionObjectIdHexString
in: path
required: true
allowEmptyValue: false
schema:
$ref: '#/components/schemas/LLMConnectionId'
get:
operationId: get-llm-connection
summary: Get LLM Connection
tags:
- LLM Connection Admin
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/LLMConnection'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
delete:
operationId: delete-llm-connection
summary: Delete LLM Connection
tags:
- LLM Connection Admin
responses:
'200':
$ref: '#/components/responses/CommonDeleteResponse'
'400':
$ref: '#/components/responses/CommonDeleteResponse'
'401':
$ref: '#/components/responses/CommonDeleteResponse'
'403':
$ref: '#/components/responses/CommonDeleteResponse'
'500':
$ref: '#/components/responses/CommonDeleteResponse'
/admin/assistant/retrieverConnection:
get:
operationId: list-retriever-connections
summary: List Retriever Connections
tags:
- Content Retriever Connection Admin
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
nullable: false
items:
$ref: '#/components/schemas/RetrieverConnection'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
post:
operationId: create-or-update-retriever-connection
summary: Create/Update Retriever Connection
tags:
- Content Retriever Connection Admin
requestBody:
required: true
content:
application/json:
schema:
title: CreateRetrieverConnectionRequest
type: object
properties:
id:
$ref: '#/components/schemas/RetrieverConnectionId'
baseRetrieverRequest:
$ref: "#/components/schemas/BaseRetrieverConnection"
embeddingType:
type: string
name:
type: string
description:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/RetrieverConnection'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
/admin/assistant/retrieverConnection/{retrieverConnectionObjectIdHexString}:
parameters:
- name: retrieverConnectionObjectIdHexString
in: path
required: true
allowEmptyValue: false
schema:
$ref: '#/components/schemas/RetrieverConnectionId'
get:
operationId: get-retriever-connection
summary: Get Retriever Connection
tags:
- Content Retriever Connection Admin
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/RetrieverConnection'
'400':
$ref: '#/components/responses/Common400Response'
'401':
$ref: '#/components/responses/Common401Response'
'403':
$ref: '#/components/responses/Common403Response'
'500':
$ref: '#/components/responses/Common500Response'
delete:
operationId: delete-retriever-connection
summary: Delete Retriever Connection
tags:
- Content Retriever Connection Admin
responses:
'200':
$ref: '#/components/responses/CommonDeleteResponse'
'400':
$ref: '#/components/responses/CommonDeleteResponse'
'401':
$ref: '#/components/responses/CommonDeleteResponse'
'403':
$ref: '#/components/responses/CommonDeleteResponse'
'500':
$ref: '#/components/responses/CommonDeleteResponse'
/assistant/chat/streamingWithFileUpload:
post:
operationId: assistant-chat-streaming-mp
summary: Assistant Chat With FileUpload (Streaming)
description: >-
Temporary endpoint to allow upload of files alongside chat request.
This endpoint will be deprecated when separate file-upload is implemented and file-references may
be included into chat messages.
tags:
- Assistant Multipart
x-streamed-response: true
requestBody:
required: true
content:
multipart/form-data:
schema:
title: AssistantChatRequestMultipart
type: object
additionalProperties: false
required:
- jsonRequest
properties:
jsonRequest:
$ref: '#/components/schemas/AssistantChatMessage'
document:
type: array
minItems: 0
maxItems: 2
items:
type: string
format: binary
x-field-extra-annotation: |+
@org.jboss.resteasy.reactive.RestForm
@org.jboss.resteasy.reactive.PartType(jakarta.ws.rs.core.MediaType.APPLICATION_OCTET_STREAM)
encoding:
jsonRequest:
contentType: application/json
document:
contentType: application/octet-stream
responses:
'200':
description: OK
content:
text/plain:
schema:
type: array
items:
type: string
'400':
$ref: '#/components/responses/PlainText400Response'
'401':
$ref: '#/components/responses/PlainText401Response'
'403':
$ref: '#/components/responses/PlainText403Response'
'500':
$ref: '#/components/responses/PlainText500Response'
/assistant/chat/streaming:
post:
operationId: assistant-chat-streaming
summary: Assistant Chat (Streaming)
x-streamed-response: true
tags:
- Assistant
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AssistantChatMessage'
responses:
'200':
description: OK
content:
text/plain:
schema:
type: array
items:
type: string
'400':
$ref: '#/components/responses/PlainText400Response'
'401':
$ref: '#/components/responses/PlainText401Response'
'403':
$ref: '#/components/responses/PlainText403Response'
'500':
$ref: '#/components/responses/PlainText500Response'
components:
schemas:
# Primitive types
ContentRetrieverType:
type: string
enum:
- weaviate
- elasticsearch
# Domain IDs
AssistantId:
description: Assistant ID in the form of a BSON Object ID's Hex String
type: string
pattern: ^[A-Fa-f0-9]{24}$
minLength: 24
maxLength: 24
nullable: false
LLMConnectionId:
description: LLM Connection ID in the form of a BSON Object ID's Hex String
type: string
pattern: ^[A-Fa-f0-9]{24}$
minLength: 24
maxLength: 24
nullable: false
RetrieverConnectionId:
description: Retriever Connection ID in the form of a BSON Object ID's Hex String
type: string
pattern: ^[A-Fa-f0-9]{24}$
minLength: 24
maxLength: 24
nullable: false
# Configuration Types
Assistant:
type: object
properties:
id:
$ref: '#/components/schemas/AssistantId'
name:
type: string
displayName:
type: string
description:
type: string
userPrompt:
type: string
exampleQuestions:
type: array
items:
type: string
llmConnectionId:
$ref: '#/components/schemas/LLMConnectionId'
llmConnection:
$ref: '#/components/schemas/LLMConnection'
retrieverConnectionId:
$ref: '#/components/schemas/RetrieverConnectionId'
retrieverConnection:
$ref: '#/components/schemas/RetrieverConnection'
BaseRetrieverConnection:
type: object
required:
- contentRetrieverType
properties:
id:
$ref: '#/components/schemas/RetrieverConnectionId'
contentRetrieverType:
$ref: '#/components/schemas/ContentRetrieverType'
oneOf:
- $ref: '#/components/schemas/ElasticsearchConnection'
- $ref: '#/components/schemas/WeaviateConnection'
discriminator:
propertyName: contentRetrieverType
mapping:
elasticsearch: '#/components/schemas/ElasticsearchConnection'
weaviate: '#/components/schemas/WeaviateConnection'
ElasticsearchConnection:
type: object
required:
- index
- host
x-discriminator-value: elasticsearch
allOf:
- $ref: '#/components/schemas/BaseRetrieverConnection'
- properties:
metadataFields:
type: array
items:
type: string
index:
type: string
host:
type: string
apiKey:
type: string
user:
type: string
password:
type: string
WeaviateConnection:
type: object
x-discriminator-value: weaviate
allOf:
- $ref: '#/components/schemas/BaseRetrieverConnection'
- properties:
textKey:
type: string
metadataFields:
type: array
items:
type: string
index:
type: string
scheme:
type: string
host:
type: string
apiKey:
type: string
LLMConnection:
type: object
properties:
id:
$ref: '#/components/schemas/LLMConnectionId'
name:
type: string
description:
type: string
modelType:
type: string
servingRuntimeType:
type: string
url:
type: string
apiKey:
type: string
modelName:
type: string
temperature:
type: number
format: double
maxTokens:
type: integer
RetrieverConnection:
type: object
properties:
id:
$ref: '#/components/schemas/RetrieverConnectionId'
name:
type: string
description:
type: string
embeddingType:
type: string
connectionEntity:
$ref: '#/components/schemas/BaseRetrieverConnection'
# Common Command Types
AssistantChatMessage:
type: object
required:
- message
properties:
message:
type: string
nullable: false
context:
type: string
nullable: true
assistantId:
$ref: '#/components/schemas/AssistantId'
assistantName:
type: string
nullable: false
minLength: 1
x-field-extra-annotation: |+
@org.jboss.resteasy.reactive.RestForm
@org.jboss.resteasy.reactive.PartType(jakarta.ws.rs.core.MediaType.APPLICATION_JSON)
# Common Error Types
CommonError:
type: object
# TODO: Define common error response structure
additionalProperties: true
responses:
Common400Response:
description: Bad Request, with error details (ie, request validation failures) as JSON object.
content:
application/json:
schema:
# TODO: Create a validation failure type
$ref: '#/components/schemas/CommonError'
Common401Response:
description: Not Authorized, with error details as a JSON object
content:
application/json:
schema:
$ref: '#/components/schemas/CommonError'
Common403Response:
description: Not Allowed, with error details as a JSON object
content:
application/json:
schema:
$ref: '#/components/schemas/CommonError'
Common500Response:
description: Server Error, with details as a JSON object
content:
application/json:
schema:
$ref: '#/components/schemas/CommonError'
PlainText400Response:
description: Bad Request, with error details in plain text
content:
text/plain:
schema:
type: string
PlainText401Response:
description: Not Authorized, with error details in plain text
content:
text/plain:
schema:
type: string
PlainText403Response:
description: Not Allowed, with error details in plain text
content:
text/plain:
schema:
type: string
PlainText500Response:
description: Server Error, with error details in plain text
content:
text/plain:
schema:
type: string
CommonDeleteResponse:
description: Empty response, since DELETE method disallows content body
# Note: A lack of the `content` property here indicates that there is no response body.
# securitySchemes:
# OIDC:
# openIdConnectUrl: example.com
# type: openIdConnect
# description: Authentication via OpenID Connect