-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathansible-ai-connect-service.yaml
1452 lines (1451 loc) · 39.1 KB
/
ansible-ai-connect-service.yaml
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
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Ansible AI Connect.
version: 0.0.9 (v0)
description: Equip the automation developer at Lightspeed.
paths:
/api/v0/ai/chat/:
post:
operationId: ai_chat_create
description: Send a message to the backend chatbot service and get a reply.
summary: Chat request
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ChatRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ChatRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/ChatRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ChatResponse'
description: ''
'400':
description: Bad request
'403':
description: Forbidden
'413':
description: Prompt too long
'422':
description: Validation failed
'500':
description: Internal server error
'503':
description: Service unavailable
/api/v0/ai/completions/:
post:
operationId: ai_completions_create
description: Returns inline code suggestions based on a given Ansible editor
context.
summary: Inline code suggestions
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CompletionRequest'
examples:
ValidExample:
value:
prompt: |
---
- hosts: all
become: yes
tasks:
- name: Install ssh
summary: Request Sample
description: A valid sample request.
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/CompletionRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/CompletionRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CompletionResponse'
examples:
ValidExample:
value:
predictions:
- |2-
ansible.builtin.package:
name: openssh-server
state: present
summary: Response sample
description: A valid sample response.
description: ''
'204':
description: Empty response
'400':
description: Bad Request
'401':
description: Unauthorized
'429':
description: Request was throttled
'503':
description: Service Unavailable
/api/v0/ai/contentmatches/:
post:
operationId: ai_contentmatches_create
description: Returns content matches that were the highest likelihood sources
for a given code suggestion.
summary: Code suggestion attributions
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContentMatchRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContentMatchRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContentMatchRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContentMatchResponse'
description: ''
'400':
description: Bad Request
'401':
description: Unauthorized
'429':
description: Request was throttled
'503':
description: Service Unavailable
/api/v0/ai/explanations/:
post:
operationId: ai_explanations_create
description: Returns a text that explains a playbook.
summary: Inline code suggestions
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ExplanationRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ExplanationRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/ExplanationRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ExplanationResponse'
description: ''
'204':
description: Empty response
'400':
description: Bad Request
'401':
description: Unauthorized
'429':
description: Request was throttled
'503':
description: Service Unavailable
/api/v0/ai/feedback/:
post:
operationId: ai_feedback_create
description: Feedback API for the AI service
summary: Feedback API for the AI service
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackRequest'
examples:
ValidInlineSuggestionFeedbackExample:
value:
inlineSuggestion:
userActionTime: 5155
action: '0'
suggestionId: a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6
summary: Feedback Request sample for inline suggestion to identify
if the suggestion is accepted or ignored.
description: A valid inline suggestion feedback sample request to
get details about the suggestion like user decision time, user action
and suggestion id.
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/FeedbackRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/FeedbackRequest'
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
description: Success
'400':
description: Bad Request
'401':
description: Unauthorized
/api/v0/ai/generations/:
post:
operationId: ai_generations_create
description: Returns a playbook based on a text input.
summary: Inline code suggestions
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationPlaybookRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/GenerationPlaybookRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/GenerationPlaybookRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationPlaybookResponse'
description: ''
'204':
description: Empty response
'400':
description: Bad Request
'401':
description: Unauthorized
'429':
description: Request was throttled
'503':
description: Service Unavailable
/api/v0/ai/generations/playbook:
post:
operationId: ai_generations_playbook_create
description: Returns a playbook based on a text input.
summary: Inline code suggestions
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationPlaybookRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/GenerationPlaybookRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/GenerationPlaybookRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationPlaybookResponse'
description: ''
'204':
description: Empty response
'400':
description: Bad Request
'401':
description: Unauthorized
'429':
description: Request was throttled
'503':
description: Service Unavailable
/api/v0/ai/generations/role:
post:
operationId: ai_generations_role_create
description: Returns a role based on a text input.
summary: Inline code suggestions
tags:
- ai
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationRoleRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/GenerationRoleRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/GenerationRoleRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationRoleResponse'
description: ''
'401':
description: Unauthorized
/api/v0/me/:
get:
operationId: me_retrieve
tags:
- me
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/UserResponse'
description: ''
/api/v0/me/summary/:
get:
operationId: me_summary_retrieve
tags:
- me
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/MarkdownUserResponse'
description: ''
/api/v0/telemetry/:
get:
operationId: telemetry_settings_get
summary: Get the telemetry settings for an Organisation
tags:
- telemetry
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
description: OK
'400':
description: Bad Request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
post:
operationId: telemetry_settings_set
summary: Set the Telemetry settings for an Organisation
tags:
- telemetry
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TelemetrySettingsRequest'
examples:
ValidExample:
value:
optOut: 'true'
summary: Request Telemetry settings
description: A valid request to set the Telemetry settings.
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/TelemetrySettingsRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/TelemetrySettingsRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'204':
description: Empty response
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
/api/v0/wca/apikey/:
get:
operationId: wca_api_key_get
summary: Get WCA key for an Organisation
tags:
- wca
security:
- oauth2:
- read
- write
- delete
- cookieAuth: []
responses:
'200':
description: OK
'400':
description: Bad Request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
post:
operationId: wca_api_key_set
summary: Set the WCA key for an Organisation
tags:
- wca
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WcaKeyRequest'
examples:
ValidExample:
value:
key: '1234567890'
summary: Request Sample
description: A valid WCA Key request.
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/WcaKeyRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/WcaKeyRequest'
required: true
security:
- oauth2:
- read
- write
- delete
- cookieAuth: []
responses:
'204':
description: Empty response
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
delete:
operationId: wca_api_key_delete
summary: DELETE WCA key for an Organization
tags:
- wca
security:
- oauth2:
- read
- write
- delete
- cookieAuth: []
responses:
'204':
description: Empty response
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
/api/v0/wca/apikey/test/:
get:
operationId: wca_api_key_validator_get
summary: Validate WCA key for an Organisation
tags:
- wca
security:
- oauth2:
- read
- cookieAuth: []
responses:
'200':
description: OK
'400':
description: Bad Request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
/api/v0/wca/modelid/:
get:
operationId: wca_model_id_get
summary: Get WCA Model Id for an Organisation
tags:
- wca
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'200':
description: OK
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
post:
operationId: wca_model_id_set
summary: Set the Model Id to be used for an Organisation
tags:
- wca
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WcaModelIdRequest'
examples:
ValidExample:
value:
model_id: '1234567890'
summary: Request Sample
description: A valid WCA Model Id request.
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/WcaModelIdRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/WcaModelIdRequest'
required: true
security:
- oauth2:
- read
- write
- cookieAuth: []
responses:
'204':
description: Empty response
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
/api/v0/wca/modelid/test/:
get:
operationId: wca_model_id_validator_get
summary: Validate WCA Model Id for an Organisation
tags:
- wca
security:
- oauth2:
- read
- cookieAuth: []
responses:
'200':
description: OK
'400':
description: Bad Request
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Request was throttled
'500':
description: Internal service error
/check/:
get:
operationId: check_retrieve
description: Service Liveness Probe View
summary: Liveness probe
tags:
- check
security:
- cookieAuth: []
- {}
responses:
'200':
description: OK
/check/status/:
get:
operationId: check_status_retrieve
description: Service Health Check
summary: Health check with backend server status
tags:
- check
security:
- cookieAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: {}
examples:
ExampleOutput:
value:
status: ok
timestamp: '2023-03-13T17:25:17.240683'
version: latest 0.1.202303131417
git_commit: b987bc43b90f8aca2deaf3bda85596f4b95a10a0
deployed_region: dev
dependencies:
- name: db
status: ok
time_taken: 233.538
- name: model-server
status: ok
time_taken: 0.001
summary: Example output
description: ''
'500':
description: One or more backend services are unavailable.
components:
schemas:
Action4c6Enum:
enum:
- '0'
- '1'
- '2'
type: string
description: |-
* `0` - ACCEPTED
* `1` - REJECTED
* `2` - IGNORED
ChatFeedback:
type: object
properties:
query:
type: string
title: Prompt
description: Prompt being sent to the LLM.
response:
$ref: '#/components/schemas/ChatResponse'
sentiment:
$ref: '#/components/schemas/SentimentEnum'
required:
- query
- response
- sentiment
ChatRequest:
type: object
properties:
conversation_id:
type: string
format: uuid
description: A UUID that identifies the particular conversation is being
requested for.
query:
type: string
title: Query string
description: A query string to be sent to LLM.
model:
type: string
title: Model name
description: A model to be used on LLM.
provider:
type: string
title: Provider name
description: A name that identifies a LLM provider.
system_prompt:
type: string
description: An optional non-default system prompt to be used on LLM (debug
mode only).
required:
- query
ChatResponse:
type: object
properties:
conversation_id:
type: string
format: uuid
description: A UUID that identifies the particular conversation is being
requested for.
referenced_documents:
type: array
items:
$ref: '#/components/schemas/ReferencedDocuments'
response:
type: string
truncated:
type: boolean
required:
- conversation_id
- response
- truncated
CompletionMetadata:
type: object
properties:
ansibleExtensionVersion:
type: string
title: Ansible vscode/vscodium extension version
description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH
pattern: v?\d+\.\d+\.\d+
documentUri:
type: string
activityId:
type: string
format: uuid
title: Activity ID
description: A UUID that identifies a user activity session within a given
document.
ansibleFileType:
type: string
title: Ansible File Type
description: Ansible file type (playbook/tasks_in_role/tasks)
additionalContext:
type: object
additionalProperties: {}
title: Additional Context
description: Additional context for completion API
CompletionRequest:
type: object
properties:
ansibleExtensionVersion:
type: string
title: Ansible vscode/vscodium extension version
description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH
pattern: v?\d+\.\d+\.\d+
prompt:
type: string
description: Editor prompt.
suggestionId:
type: string
format: uuid
title: Suggestion ID
description: A UUID that identifies a suggestion.
metadata:
$ref: '#/components/schemas/CompletionMetadata'
model:
type: string
required:
- prompt
CompletionResponse:
type: object
properties:
model:
type: string
suggestionId:
type: string
format: uuid
predictions:
type: array
items:
type: string
required:
- predictions
ContentMatch:
type: object
properties:
repo_name:
type: string
repo_url:
type: string
format: uri
path:
type: string
license:
type: string
data_source_description:
type: string
score:
type: number
format: double
required:
- data_source_description
- license
- path
- repo_name
- repo_url
- score
ContentMatchList:
type: object
properties:
contentmatch:
type: array
items:
$ref: '#/components/schemas/ContentMatch'
required:
- contentmatch
ContentMatchRequest:
type: object
properties:
ansibleExtensionVersion:
type: string
title: Ansible vscode/vscodium extension version
description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH
pattern: v?\d+\.\d+\.\d+
suggestions:
type: array
items:
type: string
suggestionId:
type: string
format: uuid
title: Suggestion ID
description: A UUID that identifies the particular suggestion content match
data is being requested for.
model:
type: string
metadata:
$ref: '#/components/schemas/Metadata'
required:
- suggestions
ContentMatchResponse:
type: object
properties:
contentmatches:
type: array
items:
$ref: '#/components/schemas/ContentMatchList'
required:
- contentmatches
ExplanationRequest:
type: object
properties:
ansibleExtensionVersion:
type: string
title: Ansible vscode/vscodium extension version
description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH
pattern: v?\d+\.\d+\.\d+
content:
type: string
title: Playbook content
description: The playbook that needs to be explained.
customPrompt:
type: string
default: ''
title: Custom prompt
description: Custom prompt passed to the LLM when explaining a playbook.
explanationId:
type: string
format: uuid
default: ''
title: Explanation ID
description: A UUID that identifies the particular explanation data is being
requested for.
model:
type: string
default: ''
metadata:
$ref: '#/components/schemas/Metadata'
required:
- content
ExplanationResponse:
type: object
properties:
content:
type: string
format:
type: string
explanationId:
type: string
format: uuid
title: Explanation ID
description: A UUID that identifies the particular explanation data is being
requested for.
required:
- content
- format
FeedbackRequest:
type: object
properties:
ansibleExtensionVersion:
type: string
title: Ansible vscode/vscodium extension version
description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH
pattern: v?\d+\.\d+\.\d+
inlineSuggestion:
$ref: '#/components/schemas/InlineSuggestionFeedback'
issueFeedback:
$ref: '#/components/schemas/IssueFeedback'
metadata:
$ref: '#/components/schemas/Metadata'
model:
type: string
playbookExplanationFeedback:
$ref: '#/components/schemas/PlaybookExplanationFeedback'
playbookGenerationFeedback:
$ref: '#/components/schemas/PlaybookGenerationFeedback'
playbookGenerationAction:
$ref: '#/components/schemas/PlaybookGenerationAction'
sentimentFeedback:
$ref: '#/components/schemas/SentimentFeedback'
suggestionQualityFeedback:
$ref: '#/components/schemas/SuggestionQualityFeedback'
chatFeedback:
$ref: '#/components/schemas/ChatFeedback'
GenerationPlaybookRequest:
type: object
properties:
text:
type: string
title: Description content
description: The description that needs to be converted to a playbook.
customPrompt:
type: string
default: ''
title: Custom prompt
description: Custom prompt passed to the LLM when generating the text of
a playbook.
generationId:
type: string
format: uuid
default: ''
title: generation ID
description: A UUID that identifies the particular generation data is being
requested for.
createOutline:
type: boolean
default: false
title: generate outline
description: Indicates whether the answer should also include an outline
of the Ansible Playbook.
outline:
type: string
default: ''
description: A long step by step outline of the expected Ansible Playbook.