-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
generated.json
1388 lines (1388 loc) · 53.9 KB
/
generated.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
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
{
"swagger": "2.0",
"info": {
"title": "Azure OpenAI API",
"version": "2023-06-01-preview",
"description": "Azure OpenAI APIs for completions and search",
"x-typespec-generated": [
{
"emitter": "@azure-tools/typespec-autorest"
}
]
},
"schemes": [
"https"
],
"x-ms-parameterized-host": {
"hostTemplate": "{endpoint}/openai",
"useSchemePrefix": false,
"parameters": [
{
"name": "endpoint",
"in": "path",
"description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).",
"required": true,
"type": "string"
}
]
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"security": [
{
"ApiKeyAuth": []
},
{
"OAuth2Auth": [
"https://cognitiveservices.azure.com/.default"
]
}
],
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "api-key",
"in": "header"
},
"OAuth2Auth": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
"scopes": {
"https://cognitiveservices.azure.com/.default": ""
}
}
},
"tags": [],
"paths": {
"/deployments/{deploymentId}/chat/completions": {
"post": {
"operationId": "GetChatCompletions",
"description": "Gets chat completions for the provided chat messages.\nCompletions support a wide variety of tasks and generate text that continues from or \"completes\"\nprovided prompt data.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "deploymentId",
"in": "path",
"description": "Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ChatCompletionsOptions"
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/ChatCompletions"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Creates a completion for the provided prompt, parameters and chosen model.": {
"$ref": "./examples/chat_completions.json"
}
}
}
},
"/deployments/{deploymentId}/completions": {
"post": {
"operationId": "GetCompletions",
"description": "Gets completions for the provided input prompts.\nCompletions support a wide variety of tasks and generate text that continues from or \"completes\"\nprovided prompt data.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "deploymentId",
"in": "path",
"description": "Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/CompletionsOptions"
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/Completions"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Creates a completion for the provided prompt, parameters and chosen model.": {
"$ref": "./examples/completions.json"
}
}
}
},
"/deployments/{deploymentId}/embeddings": {
"post": {
"operationId": "GetEmbeddings",
"description": "Return the embeddings for a given prompt.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "deploymentId",
"in": "path",
"description": "Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/EmbeddingsOptions"
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/Embeddings"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Return the embeddings for a given prompt.": {
"$ref": "./examples/embeddings.json"
}
}
}
},
"/images/generations:submit": {
"post": {
"operationId": "BeginAzureBatchImageGeneration",
"description": "Starts the generation of a batch of images from a text caption",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/ImageGenerationOptions"
}
}
],
"responses": {
"202": {
"description": "The request has been accepted for processing, but processing has not yet completed.",
"schema": {
"$ref": "#/definitions/BatchImageGenerationOperationResponse"
},
"headers": {
"Operation-Location": {
"type": "string",
"format": "uri",
"description": "The location for monitoring the operation state."
}
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Starts the generation of a batch of images from a text caption": {
"$ref": "./examples/start_generate_image.json"
}
},
"x-ms-long-running-operation": true
}
},
"/operations/images/{operationId}": {
"get": {
"operationId": "GetAzureBatchImageGenerationOperationStatus",
"description": "Returns the status of the images operation",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "operationId",
"in": "path",
"description": ".",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/BatchImageGenerationOperationResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Returns the status of the images operation": {
"$ref": "./examples/get_image_operation_status.json"
}
}
}
}
},
"definitions": {
"Azure.Core.Foundations.Error": {
"type": "object",
"description": "The error object.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"message": {
"type": "string",
"description": "A human-readable representation of the error."
},
"target": {
"type": "string",
"description": "The target of the error."
},
"details": {
"type": "array",
"description": "An array of details about specific errors that led to this reported error.",
"items": {
"$ref": "#/definitions/Azure.Core.Foundations.Error"
},
"x-ms-identifiers": []
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "An object containing more specific information than the current object about the error."
}
},
"required": [
"code",
"message"
]
},
"Azure.Core.Foundations.ErrorResponse": {
"type": "object",
"description": "A response containing error details.",
"properties": {
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "The error object."
}
},
"required": [
"error"
]
},
"Azure.Core.Foundations.InnerError": {
"type": "object",
"description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "Inner error."
}
}
},
"AzureOpenAIOperationState": {
"type": "string",
"description": "The state of a job or item.",
"enum": [
"notRunning",
"running",
"succeeded",
"canceled",
"failed"
],
"x-ms-enum": {
"name": "AzureOpenAIOperationState",
"modelAsString": true,
"values": [
{
"name": "notRunning",
"value": "notRunning",
"description": "The operation was created and is queued to be processed in the future."
},
{
"name": "running",
"value": "running",
"description": "The operation has started to be processed."
},
{
"name": "succeeded",
"value": "succeeded",
"description": "The operation has successfully be processed and is ready for consumption."
},
{
"name": "canceled",
"value": "canceled",
"description": "The operation has been canceled and is incomplete."
},
{
"name": "failed",
"value": "failed",
"description": "The operation has completed processing with a failure and cannot be further consumed."
}
]
}
},
"BatchImageGenerationOperationResponse": {
"type": "object",
"description": "A polling status update or final response payload for an image operation.",
"properties": {
"id": {
"type": "string",
"description": "The ID of the operation."
},
"created": {
"type": "integer",
"format": "unixtime",
"description": "A timestamp when this job or item was created (in unix epochs)."
},
"expires": {
"type": "integer",
"format": "int64",
"description": "A timestamp when this operation and its associated images expire and will be deleted (in unix epochs)."
},
"result": {
"$ref": "#/definitions/ImageGenerations",
"description": "The result of the operation if the operation succeeded."
},
"status": {
"$ref": "#/definitions/AzureOpenAIOperationState",
"description": "The status of the operation"
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "The error if the operation failed."
}
},
"required": [
"id",
"created",
"status"
]
},
"ChatChoice": {
"type": "object",
"description": "The representation of a single prompt completion as part of an overall chat completions request.\nGenerally, `n` choices are generated per provided prompt with a default value of 1.\nToken limits and other settings may limit the number of choices generated.",
"properties": {
"message": {
"$ref": "#/definitions/ChatResponseMessage",
"description": "The chat message for a given chat completions prompt."
},
"index": {
"type": "integer",
"format": "int32",
"description": "The ordered index associated with this chat completions choice."
},
"finish_reason": {
"$ref": "#/definitions/CompletionsFinishReason",
"description": "The reason that this chat completions choice completed its generated.",
"x-nullable": true,
"x-ms-client-name": "finishReason"
},
"delta": {
"$ref": "#/definitions/ChatResponseMessage",
"description": "The delta message content for a streaming response."
},
"content_filter_results": {
"$ref": "#/definitions/ContentFilterResultsForChoice",
"description": "Information about the content filtering category (hate, sexual, violence, self_harm), if it\nhas been detected, as well as the severity level (very_low, low, medium, high-scale that\ndetermines the intensity and risk level of harmful content) and if it has been filtered or not.",
"x-ms-client-name": "contentFilterResults"
}
},
"required": [
"index",
"finish_reason"
]
},
"ChatCompletions": {
"type": "object",
"description": "Representation of the response data from a chat completions request.\nCompletions support a wide variety of tasks and generate text that continues from or \"completes\"\nprovided prompt data.",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier associated with this chat completions response."
},
"created": {
"type": "integer",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"choices": {
"type": "array",
"description": "The collection of completions choices associated with this completions response.\nGenerally, `n` choices are generated per provided prompt with a default value of 1.\nToken limits and other settings may limit the number of choices generated.",
"items": {
"$ref": "#/definitions/ChatChoice"
},
"x-ms-identifiers": []
},
"model": {
"type": "string",
"description": "The model name used for this completions request."
},
"prompt_filter_results": {
"type": "array",
"description": "Content filtering results for zero or more prompts in the request. In a streaming request,\nresults for different prompts may arrive at different times or in different orders.",
"items": {
"$ref": "#/definitions/ContentFilterResultsForPrompt"
},
"x-ms-client-name": "promptFilterResults",
"x-ms-identifiers": []
},
"usage": {
"$ref": "#/definitions/CompletionsUsage",
"description": "Usage information for tokens processed and generated as part of this completions operation."
}
},
"required": [
"id",
"created",
"choices",
"usage"
]
},
"ChatCompletionsOptions": {
"type": "object",
"description": "The configuration information for a chat completions request.\nCompletions support a wide variety of tasks and generate text that continues from or \"completes\"\nprovided prompt data.",
"properties": {
"messages": {
"type": "array",
"description": "The collection of context messages associated with this chat completions request.\nTypical usage begins with a chat message for the System role that provides instructions for\nthe behavior of the assistant, followed by alternating messages between the User and\nAssistant roles.",
"items": {
"$ref": "#/definitions/ChatRequestMessage"
},
"x-ms-identifiers": []
},
"max_tokens": {
"type": "integer",
"format": "int32",
"description": "The maximum number of tokens to generate.",
"x-ms-client-name": "maxTokens"
},
"temperature": {
"type": "number",
"format": "float",
"description": "The sampling temperature to use that controls the apparent creativity of generated completions.\nHigher values will make output more random while lower values will make results more focused\nand deterministic.\nIt is not recommended to modify temperature and top_p for the same completions request as the\ninteraction of these two settings is difficult to predict."
},
"top_p": {
"type": "number",
"format": "float",
"description": "An alternative to sampling with temperature called nucleus sampling. This value causes the\nmodel to consider the results of tokens with the provided probability mass. As an example, a\nvalue of 0.15 will cause only the tokens comprising the top 15% of probability mass to be\nconsidered.\nIt is not recommended to modify temperature and top_p for the same completions request as the\ninteraction of these two settings is difficult to predict.",
"x-ms-client-name": "topP"
},
"logit_bias": {
"type": "object",
"description": "A map between GPT token IDs and bias scores that influences the probability of specific tokens\nappearing in a completions response. Token IDs are computed via external tokenizer tools, while\nbias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to\na full ban or exclusive selection of a token, respectively. The exact behavior of a given bias\nscore varies by model.",
"additionalProperties": {
"format": "int32",
"type": "integer"
},
"x-ms-client-name": "logitBias"
},
"user": {
"type": "string",
"description": "An identifier for the caller or end user of the operation. This may be used for tracking\nor rate-limiting purposes."
},
"n": {
"type": "integer",
"format": "int32",
"description": "The number of chat completions choices that should be generated for a chat completions\nresponse.\nBecause this setting can generate many completions, it may quickly consume your token quota.\nUse carefully and ensure reasonable settings for max_tokens and stop."
},
"stop": {
"type": "array",
"description": "A collection of textual sequences that will end completions generation.",
"items": {
"type": "string"
}
},
"presence_penalty": {
"type": "number",
"format": "float",
"description": "A value that influences the probability of generated tokens appearing based on their existing\npresence in generated text.\nPositive values will make tokens less likely to appear when they already exist and increase the\nmodel's likelihood to output new topics.",
"x-ms-client-name": "presencePenalty"
},
"frequency_penalty": {
"type": "number",
"format": "float",
"description": "A value that influences the probability of generated tokens appearing based on their cumulative\nfrequency in generated text.\nPositive values will make tokens less likely to appear as their frequency increases and\ndecrease the likelihood of the model repeating the same statements verbatim.",
"x-ms-client-name": "frequencyPenalty"
},
"stream": {
"type": "boolean",
"description": "A value indicating whether chat completions should be streamed for this request."
},
"model": {
"type": "string",
"description": "The model name to provide as part of this completions request.\nNot applicable to Azure OpenAI, where deployment information should be included in the Azure\nresource URI that's connected to."
}
},
"required": [
"messages"
]
},
"ChatRequestAssistantMessage": {
"type": "object",
"description": "A request chat message representing response or action from the assistant.",
"properties": {
"content": {
"type": "string",
"description": "The content of the message.",
"x-nullable": true
},
"name": {
"type": "string",
"description": "An optional name for the participant."
}
},
"required": [
"content"
],
"allOf": [
{
"$ref": "#/definitions/ChatRequestMessage"
}
],
"x-ms-discriminator-value": "assistant"
},
"ChatRequestMessage": {
"type": "object",
"description": "An abstract representation of a chat message as provided in a request.",
"properties": {
"role": {
"$ref": "#/definitions/ChatRole",
"description": "The chat role associated with this message."
}
},
"discriminator": "role",
"required": [
"role"
]
},
"ChatRequestSystemMessage": {
"type": "object",
"description": "A request chat message containing system instructions that influence how the model will generate a chat completions\nresponse.",
"properties": {
"content": {
"type": "string",
"description": "The contents of the system message."
},
"name": {
"type": "string",
"description": "An optional name for the participant."
}
},
"required": [
"content"
],
"allOf": [
{
"$ref": "#/definitions/ChatRequestMessage"
}
],
"x-ms-discriminator-value": "system"
},
"ChatRequestUserMessage": {
"type": "object",
"description": "A request chat message representing user input to the assistant.",
"properties": {
"content": {
"description": "The contents of the user message, with available input types varying by selected model."
},
"name": {
"type": "string",
"description": "An optional name for the participant."
}
},
"required": [
"content"
],
"allOf": [
{
"$ref": "#/definitions/ChatRequestMessage"
}
],
"x-ms-discriminator-value": "user"
},
"ChatResponseMessage": {
"type": "object",
"description": "A representation of a chat message as received in a response.",
"properties": {
"role": {
"$ref": "#/definitions/ChatRole",
"description": "The chat role associated with the message."
},
"content": {
"type": "string",
"description": "The content of the message.",
"x-nullable": true
}
},
"required": [
"role",
"content"
]
},
"ChatRole": {
"type": "string",
"description": "A description of the intended purpose of a message within a chat completions interaction.",
"enum": [
"system",
"assistant",
"user"
],
"x-ms-enum": {
"name": "ChatRole",
"modelAsString": true,
"values": [
{
"name": "system",
"value": "system",
"description": "The role that instructs or sets the behavior of the assistant."
},
{
"name": "assistant",
"value": "assistant",
"description": "The role that provides responses to system-instructed, user-prompted input."
},
{
"name": "user",
"value": "user",
"description": "The role that provides input for chat completions."
}
]
}
},
"Choice": {
"type": "object",
"description": "The representation of a single prompt completion as part of an overall completions request.\nGenerally, `n` choices are generated per provided prompt with a default value of 1.\nToken limits and other settings may limit the number of choices generated.",
"properties": {
"text": {
"type": "string",
"description": "The generated text for a given completions prompt."
},
"index": {
"type": "integer",
"format": "int32",
"description": "The ordered index associated with this completions choice."
},
"content_filter_results": {
"$ref": "#/definitions/ContentFilterResultsForChoice",
"description": "Information about the content filtering category (hate, sexual, violence, self_harm), if it\nhas been detected, as well as the severity level (very_low, low, medium, high-scale that\ndetermines the intensity and risk level of harmful content) and if it has been filtered or not.",
"x-ms-client-name": "contentFilterResults"
},
"logprobs": {
"type": "object",
"description": "The log probabilities model for tokens associated with this completions choice.",
"x-nullable": true,
"allOf": [
{
"$ref": "#/definitions/CompletionsLogProbabilityModel"
}
]
},
"finish_reason": {
"$ref": "#/definitions/CompletionsFinishReason",
"description": "Reason for finishing",
"x-nullable": true,
"x-ms-client-name": "finishReason"
}
},
"required": [
"text",
"index",
"logprobs",
"finish_reason"
]
},
"Completions": {
"type": "object",
"description": "Representation of the response data from a completions request.\nCompletions support a wide variety of tasks and generate text that continues from or \"completes\"\nprovided prompt data.",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier associated with this completions response."
},
"created": {
"type": "integer",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"prompt_filter_results": {
"type": "array",
"description": "Content filtering results for zero or more prompts in the request. In a streaming request,\nresults for different prompts may arrive at different times or in different orders.",
"items": {
"$ref": "#/definitions/ContentFilterResultsForPrompt"
},
"x-ms-client-name": "promptFilterResults",
"x-ms-identifiers": []
},
"choices": {
"type": "array",
"description": "The collection of completions choices associated with this completions response.\nGenerally, `n` choices are generated per provided prompt with a default value of 1.\nToken limits and other settings may limit the number of choices generated.",
"items": {
"$ref": "#/definitions/Choice"
},
"x-ms-identifiers": []
},
"usage": {
"$ref": "#/definitions/CompletionsUsage",
"description": "Usage information for tokens processed and generated as part of this completions operation."
}
},
"required": [
"id",
"created",
"choices",
"usage"
]
},
"CompletionsFinishReason": {
"type": "string",
"description": "Representation of the manner in which a completions response concluded.",
"enum": [
"stop",
"length",
"content_filter"
],
"x-ms-enum": {
"name": "CompletionsFinishReason",
"modelAsString": true,
"values": [
{
"name": "stopped",
"value": "stop",
"description": "Completions ended normally and reached its end of token generation."
},
{
"name": "tokenLimitReached",
"value": "length",
"description": "Completions exhausted available token limits before generation could complete."
},
{
"name": "contentFiltered",
"value": "content_filter",
"description": "Completions generated a response that was identified as potentially sensitive per content\nmoderation policies."
}
]
}
},
"CompletionsLogProbabilityModel": {
"type": "object",
"description": "Representation of a log probabilities model for a completions generation.",
"properties": {
"tokens": {
"type": "array",
"description": "The textual forms of tokens evaluated in this probability model.",
"items": {
"type": "string"
}
},
"token_logprobs": {
"type": "array",
"description": "A collection of log probability values for the tokens in this completions data.",
"items": {
"type": "number",
"format": "float",
"x-nullable": true
},
"x-ms-client-name": "tokenLogprobs"
},
"top_logprobs": {
"type": "array",
"description": "A mapping of tokens to maximum log probability values in this completions data.",
"items": {
"type": "object",
"additionalProperties": {
"format": "float",
"type": "number",
"x-nullable": true
}
},
"x-ms-client-name": "topLogprobs",
"x-ms-identifiers": []
},
"text_offset": {
"type": "array",
"description": "The text offsets associated with tokens in this completions data.",
"items": {
"type": "integer",
"format": "int32"
},
"x-ms-client-name": "textOffset"
}
},
"required": [
"tokens",
"token_logprobs",
"top_logprobs",
"text_offset"
]
},
"CompletionsOptions": {
"type": "object",
"description": "The configuration information for a completions request.\nCompletions support a wide variety of tasks and generate text that continues from or \"completes\"\nprovided prompt data.",
"properties": {
"prompt": {
"type": "array",
"description": "The prompts to generate completions from.",
"items": {
"type": "string"
}
},
"max_tokens": {
"type": "integer",
"format": "int32",
"description": "The maximum number of tokens to generate.",
"x-ms-client-name": "maxTokens"
},
"temperature": {
"type": "number",
"format": "float",
"description": "The sampling temperature to use that controls the apparent creativity of generated completions.\nHigher values will make output more random while lower values will make results more focused\nand deterministic.\nIt is not recommended to modify temperature and top_p for the same completions request as the\ninteraction of these two settings is difficult to predict."
},
"top_p": {
"type": "number",
"format": "float",
"description": "An alternative to sampling with temperature called nucleus sampling. This value causes the\nmodel to consider the results of tokens with the provided probability mass. As an example, a\nvalue of 0.15 will cause only the tokens comprising the top 15% of probability mass to be\nconsidered.\nIt is not recommended to modify temperature and top_p for the same completions request as the\ninteraction of these two settings is difficult to predict.",
"x-ms-client-name": "topP"
},
"logit_bias": {
"type": "object",
"description": "A map between GPT token IDs and bias scores that influences the probability of specific tokens\nappearing in a completions response. Token IDs are computed via external tokenizer tools, while\nbias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to\na full ban or exclusive selection of a token, respectively. The exact behavior of a given bias\nscore varies by model.",
"additionalProperties": {
"format": "int32",
"type": "integer"
},
"x-ms-client-name": "logitBias"
},
"user": {
"type": "string",
"description": "An identifier for the caller or end user of the operation. This may be used for tracking\nor rate-limiting purposes."
},
"n": {
"type": "integer",
"format": "int32",
"description": "The number of completions choices that should be generated per provided prompt as part of an\noverall completions response.\nBecause this setting can generate many completions, it may quickly consume your token quota.\nUse carefully and ensure reasonable settings for max_tokens and stop."
},
"logprobs": {
"type": "integer",
"format": "int32",
"description": "A value that controls the emission of log probabilities for the provided number of most likely\ntokens within a completions response."
},
"suffix": {
"type": "string",
"description": "The suffix that comes after a completion of inserted text"
},
"echo": {
"type": "boolean",
"description": "A value specifying whether completions responses should include input prompts as prefixes to\ntheir generated output."
},
"stop": {
"type": "array",
"description": "A collection of textual sequences that will end completions generation.",
"items": {
"type": "string"
}
},
"presence_penalty": {
"type": "number",
"format": "float",
"description": "A value that influences the probability of generated tokens appearing based on their existing\npresence in generated text.\nPositive values will make tokens less likely to appear when they already exist and increase the\nmodel's likelihood to output new topics.",
"x-ms-client-name": "presencePenalty"
},
"frequency_penalty": {
"type": "number",
"format": "float",
"description": "A value that influences the probability of generated tokens appearing based on their cumulative\nfrequency in generated text.\nPositive values will make tokens less likely to appear as their frequency increases and\ndecrease the likelihood of the model repeating the same statements verbatim.",
"x-ms-client-name": "frequencyPenalty"
},
"best_of": {
"type": "integer",
"format": "int32",
"description": "A value that controls how many completions will be internally generated prior to response\nformulation.\nWhen used together with n, best_of controls the number of candidate completions and must be\ngreater than n.\nBecause this setting can generate many completions, it may quickly consume your token quota.\nUse carefully and ensure reasonable settings for max_tokens and stop.",
"x-ms-client-name": "bestOf"
},
"stream": {
"type": "boolean",
"description": "A value indicating whether chat completions should be streamed for this request."
},
"model": {