diff --git a/specification/cognitiveservices/OpenAI.Inference/client.tsp b/specification/cognitiveservices/OpenAI.Inference/client.tsp index d890f79c304f..247acdd775c8 100644 --- a/specification/cognitiveservices/OpenAI.Inference/client.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/client.tsp @@ -42,3 +42,29 @@ interface OpenAIClient { getEmbeddings is Azure.OpenAI.getEmbeddings; } + +@@clientName(Azure.OpenAI.GenerateSpeechFromTextBody.body, + "speechGenerationOptions", + "java" +); +@@clientName(Azure.OpenAI.GetAudioTranscriptionBody.body, + "audioTranscriptionOptions", + "java" +); +@@clientName(Azure.OpenAI.GetAudioTranslationBody.body, + "audioTranslationOptions", + "java" +); +@@clientName(Azure.OpenAI.GetChatCompletionsBody.body, + "chatCompletionsOptions", + "java" +); +@@clientName(Azure.OpenAI.GetCompletionsBody.body, + "completionsOptions", + "java" +); +@@clientName(Azure.OpenAI.GetEmbeddingsBody.body, "embeddingsOptions", "java"); +@@clientName(Azure.OpenAI.GetImageGenerationsBody.body, + "imageGenerationOptions", + "java" +); diff --git a/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_speech.tsp b/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_speech.tsp index ffd791b045f6..14a4deb4cb0f 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_speech.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_speech.tsp @@ -98,3 +98,15 @@ model SpeechGenerationResponse { @bodyRoot audio: bytes; } + +/** + * Get generate speech from text body. + */ +@added(ServiceApiVersions.v2024_02_15_Preview) +model GenerateSpeechFromTextBody { + /** + * A representation of the request options that control the behavior of a text-to-speech operation. + */ + @bodyRoot + body: SpeechGenerationOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_transcription.tsp b/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_transcription.tsp index 97b7963aa9ff..cdc429e24250 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_transcription.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_transcription.tsp @@ -4,6 +4,7 @@ import "./common.tsp"; namespace Azure.OpenAI; +using TypeSpec.Http; using TypeSpec.Versioning; using Azure.ClientGenerator.Core; @@ -215,3 +216,15 @@ model AudioTranscription { @added(ServiceApiVersions.v2024_04_01_Preview) words?: AudioTranscriptionWord[]; } + +/** + * Get audio transcription body. + */ +@added(ServiceApiVersions.v2024_02_15_Preview) +model GetAudioTranscriptionBody { + /** + * The configuration information for an audio transcription request. + */ + @body + body: AudioTranscriptionOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_translation.tsp b/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_translation.tsp index 9c9733e9135d..45073fcfa038 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_translation.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/audio/audio_translation.tsp @@ -4,6 +4,7 @@ import "./common.tsp"; namespace Azure.OpenAI; +using TypeSpec.Http; using TypeSpec.Versioning; using Azure.ClientGenerator.Core; @@ -157,3 +158,15 @@ model AudioTranslation { """) segments?: AudioTranslationSegment[]; } + +/** + * Get audio translation body. + */ +@added(ServiceApiVersions.v2024_02_15_Preview) +model GetAudioTranslationBody { + /** + * The configuration information for an audio translation request. + */ + @body + body: AudioTranslationOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_completions.tsp b/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_completions.tsp index e13ed63929d4..7a0adb81a445 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_completions.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_completions.tsp @@ -401,3 +401,17 @@ model ChatTokenLogProbabilityInfo { """) bytes: int32[] | null; } + +/** + * Get chat completions request body. + */ +@added(ServiceApiVersions.v2023_05_15) +model GetChatCompletionsBody { + /** + * The configuration information for a chat completions request. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. + */ + @bodyRoot + body: ChatCompletionsOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/models/completions/completions_create.tsp b/specification/cognitiveservices/OpenAI.Inference/models/completions/completions_create.tsp index 0fba24798f4a..6245bdb81bda 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/completions/completions_create.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/completions/completions_create.tsp @@ -239,3 +239,16 @@ model CompletionsLogProbabilityModel { @clientName("textOffsets", "java") textOffset: int32[]; } + +/** + * Get completions request body. + */ +model GetCompletionsBody { + /** + * The configuration information for a completions request. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. + */ + @bodyRoot + body: CompletionsOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/models/embeddings_create.tsp b/specification/cognitiveservices/OpenAI.Inference/models/embeddings_create.tsp index e698a2f1d70f..1f98e84a3e06 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/embeddings_create.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/embeddings_create.tsp @@ -103,13 +103,15 @@ model EmbeddingsUsage { totalTokens: int32; } -alias BodyParameter< - T, - TName extends valueof string = "body", - TDoc extends valueof string = "Body parameter." -> = { - @doc(TDoc) - @friendlyName(TName) +/** + * Get embeddings request body. + */ +model GetEmbeddingsBody { + /** + * The configuration information for an embeddings request. + * Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + * recommendations, and other similar scenarios. + */ @bodyRoot - body: T; -}; + body: EmbeddingsOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/models/images/images.tsp b/specification/cognitiveservices/OpenAI.Inference/models/images/images.tsp index b0619f8b0f5e..ea51a02b9d92 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/images/images.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/images/images.tsp @@ -291,3 +291,15 @@ model BatchImageGenerationOperationResponse { @doc("The error if the operation failed.") error?: Foundations.Error; } + +/** + * Get image generation body. + */ +@added(ServiceApiVersions.v2023_06_01_Preview) +model GetImageGenerationsBody { + /** + * Represents the request data used to generate images. + */ + @bodyRoot + body: ImageGenerationOptions; +} diff --git a/specification/cognitiveservices/OpenAI.Inference/routes/audio_speech.tsp b/specification/cognitiveservices/OpenAI.Inference/routes/audio_speech.tsp index 92286d6f603e..46b30cac7d33 100644 --- a/specification/cognitiveservices/OpenAI.Inference/routes/audio_speech.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/routes/audio_speech.tsp @@ -20,6 +20,6 @@ namespace Azure.OpenAI; @actionSeparator("/") op generateSpeechFromText is ResourceAction< Deployment, - BodyParameter, + GenerateSpeechFromTextBody, SpeechGenerationResponse >; diff --git a/specification/cognitiveservices/OpenAI.Inference/routes/audio_transcription.tsp b/specification/cognitiveservices/OpenAI.Inference/routes/audio_transcription.tsp index 265ba7cedba0..7745646bdd74 100644 --- a/specification/cognitiveservices/OpenAI.Inference/routes/audio_transcription.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/routes/audio_transcription.tsp @@ -28,7 +28,7 @@ namespace Azure.OpenAI; @sharedRoute op getAudioTranscriptionAsPlainText is Azure.Core.ResourceAction< Deployment, - BodyParameter, + GetAudioTranscriptionBody, // response_format must be one of: text, srt, vtt AudioTextResponse, MultipartFormDataRequestHeadersTraits & TextPlainResponseHeadersTraits >; @@ -44,7 +44,7 @@ op getAudioTranscriptionAsPlainText is Azure.Core.ResourceAction< @sharedRoute op getAudioTranscriptionAsResponseObject is Azure.Core.ResourceAction< Deployment, - BodyParameter, // response_format must be unspecified (json) or one of: json, verbose_json + GetAudioTranscriptionBody, // response_format must be unspecified (json) or one of: json, verbose_json AudioTranscription, MultipartFormDataRequestHeadersTraits >; diff --git a/specification/cognitiveservices/OpenAI.Inference/routes/audio_translation.tsp b/specification/cognitiveservices/OpenAI.Inference/routes/audio_translation.tsp index 18cf4a1d1c11..e1a058e29ae6 100644 --- a/specification/cognitiveservices/OpenAI.Inference/routes/audio_translation.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/routes/audio_translation.tsp @@ -27,7 +27,7 @@ namespace Azure.OpenAI; @sharedRoute op getAudioTranslationAsPlainText is Azure.Core.ResourceAction< Deployment, - BodyParameter, + GetAudioTranslationBody, // response_format must be one of: text, srt, vtt AudioTextResponse, MultipartFormDataRequestHeadersTraits & TextPlainResponseHeadersTraits >; @@ -42,7 +42,7 @@ op getAudioTranslationAsPlainText is Azure.Core.ResourceAction< @sharedRoute op getAudioTranslationAsResponseObject is Azure.Core.ResourceAction< Deployment, - BodyParameter, // response_format must be unspecified (json) or one of: json, verbose_json + GetAudioTranslationBody, // response_format must be unspecified (json) or one of: json, verbose_json AudioTranslation, MultipartFormDataRequestHeadersTraits >; diff --git a/specification/cognitiveservices/OpenAI.Inference/routes/completions.tsp b/specification/cognitiveservices/OpenAI.Inference/routes/completions.tsp index 109be6748818..ee30995435ff 100644 --- a/specification/cognitiveservices/OpenAI.Inference/routes/completions.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/routes/completions.tsp @@ -23,7 +23,7 @@ namespace Azure.OpenAI; @action("completions") //@convenientAPI(true) op getCompletions is Azure.Core.ResourceAction< Deployment, - BodyParameter, + GetCompletionsBody, Completions >; @@ -37,6 +37,6 @@ op getCompletions is Azure.Core.ResourceAction< @action("chat/completions") //@convenientAPI(true) op getChatCompletions is ResourceAction< Deployment, - BodyParameter, + GetChatCompletionsBody, ChatCompletions >; diff --git a/specification/cognitiveservices/OpenAI.Inference/routes/embeddings.tsp b/specification/cognitiveservices/OpenAI.Inference/routes/embeddings.tsp index ecb49b09e4b1..a9b23b38186a 100644 --- a/specification/cognitiveservices/OpenAI.Inference/routes/embeddings.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/routes/embeddings.tsp @@ -18,6 +18,6 @@ namespace Azure.OpenAI; @action("embeddings") //@convenientAPI(true) op getEmbeddings is Azure.Core.ResourceAction< Deployment, - BodyParameter, + GetEmbeddingsBody, Embeddings >; diff --git a/specification/cognitiveservices/OpenAI.Inference/routes/images.tsp b/specification/cognitiveservices/OpenAI.Inference/routes/images.tsp index b0fcec522f40..db448d387b36 100644 --- a/specification/cognitiveservices/OpenAI.Inference/routes/images.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/routes/images.tsp @@ -20,7 +20,7 @@ namespace Azure.OpenAI; @action("images/generations") op getImageGenerations is Azure.Core.ResourceAction< Deployment, - BodyParameter, + GetImageGenerationsBody, ImageGenerations >; @@ -54,7 +54,7 @@ op getAzureBatchImageGenerationOperationStatus is RpcOperation< } ) op beginAzureBatchImageGeneration is OaiLongRunningRpcOperation< - BodyParameter, + GetImageGenerationsBody, BatchImageGenerationOperationResponse, BatchImageGenerationOperationResponse >; diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json index 37e3541babb0..80ad47ec677a 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json @@ -75,13 +75,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -127,13 +121,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -179,13 +167,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -224,13 +206,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ImageGenerationOptions" - } + "$ref": "#/parameters/GetImageGenerationsBody" } ], "responses": { @@ -1384,6 +1360,46 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetImageGenerationsBody": { + "name": "body", + "in": "body", + "description": "Represents the request data used to generate images.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageGenerationOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json index bd8333d75792..5a9d2881f642 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json @@ -75,13 +75,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -127,13 +121,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -179,13 +167,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -224,13 +206,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ImageGenerationOptions" - } + "$ref": "#/parameters/GetImageGenerationsBody" } ], "responses": { @@ -1481,6 +1457,46 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetImageGenerationsBody": { + "name": "body", + "in": "body", + "description": "Represents the request data used to generate images.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageGenerationOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json index 9cd76529a51e..4100ca08b327 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json @@ -79,13 +79,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/SpeechGenerationOptions" - } + "$ref": "#/parameters/GenerateSpeechFromTextBody" } ], "responses": { @@ -402,13 +396,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -475,13 +463,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -527,13 +509,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -579,13 +555,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ImageGenerationOptions" - } + "$ref": "#/parameters/GetImageGenerationsBody" } ], "responses": { @@ -4292,6 +4262,56 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GenerateSpeechFromTextBody": { + "name": "body", + "in": "body", + "description": "A representation of the request options that control the behavior of a text-to-speech operation.", + "required": true, + "schema": { + "$ref": "#/definitions/SpeechGenerationOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetImageGenerationsBody": { + "name": "body", + "in": "body", + "description": "Represents the request data used to generate images.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageGenerationOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json index 0ad10094651e..9cbe5a8b34aa 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json @@ -79,13 +79,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/SpeechGenerationOptions" - } + "$ref": "#/parameters/GenerateSpeechFromTextBody" } ], "responses": { @@ -402,13 +396,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -475,13 +463,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -527,13 +509,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -579,13 +555,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ImageGenerationOptions" - } + "$ref": "#/parameters/GetImageGenerationsBody" } ], "responses": { @@ -4323,6 +4293,56 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GenerateSpeechFromTextBody": { + "name": "body", + "in": "body", + "description": "A representation of the request options that control the behavior of a text-to-speech operation.", + "required": true, + "schema": { + "$ref": "#/definitions/SpeechGenerationOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetImageGenerationsBody": { + "name": "body", + "in": "body", + "description": "Represents the request data used to generate images.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageGenerationOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json index cf5f9a0abc39..cca5dd586ba7 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json @@ -79,13 +79,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/SpeechGenerationOptions" - } + "$ref": "#/parameters/GenerateSpeechFromTextBody" } ], "responses": { @@ -436,13 +430,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -509,13 +497,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -561,13 +543,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -613,13 +589,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ImageGenerationOptions" - } + "$ref": "#/parameters/GetImageGenerationsBody" } ], "responses": { @@ -4491,6 +4461,56 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GenerateSpeechFromTextBody": { + "name": "body", + "in": "body", + "description": "A representation of the request options that control the behavior of a text-to-speech operation.", + "required": true, + "schema": { + "$ref": "#/definitions/SpeechGenerationOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetImageGenerationsBody": { + "name": "body", + "in": "body", + "description": "Represents the request data used to generate images.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageGenerationOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json index 1a0d46d86c47..bdcd2c2140ec 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json @@ -79,13 +79,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/SpeechGenerationOptions" - } + "$ref": "#/parameters/GenerateSpeechFromTextBody" } ], "responses": { @@ -436,13 +430,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -509,13 +497,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -561,13 +543,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -613,13 +589,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ImageGenerationOptions" - } + "$ref": "#/parameters/GetImageGenerationsBody" } ], "responses": { @@ -4808,6 +4778,56 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GenerateSpeechFromTextBody": { + "name": "body", + "in": "body", + "description": "A representation of the request options that control the behavior of a text-to-speech operation.", + "required": true, + "schema": { + "$ref": "#/definitions/SpeechGenerationOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetImageGenerationsBody": { + "name": "body", + "in": "body", + "description": "Represents the request data used to generate images.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageGenerationOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2022-12-01/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2022-12-01/generated.json index 39a5f276c4a8..67d61372b4ff 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2022-12-01/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2022-12-01/generated.json @@ -75,13 +75,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -127,13 +121,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -606,6 +594,26 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json index ab36ec1d5ceb..2b0040733354 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json @@ -75,13 +75,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/ChatCompletionsOptions" - } + "$ref": "#/parameters/GetChatCompletionsBody" } ], "responses": { @@ -127,13 +121,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/CompletionsOptions" - } + "$ref": "#/parameters/GetCompletionsBody" } ], "responses": { @@ -179,13 +167,7 @@ "type": "string" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/EmbeddingsOptions" - } + "$ref": "#/parameters/GetEmbeddingsBody" } ], "responses": { @@ -935,6 +917,36 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "GetChatCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/ChatCompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetCompletionsBody": { + "name": "body", + "in": "body", + "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.", + "required": true, + "schema": { + "$ref": "#/definitions/CompletionsOptions" + }, + "x-ms-parameter-location": "method" + }, + "GetEmbeddingsBody": { + "name": "body", + "in": "body", + "description": "The configuration information for an embeddings request.\nEmbeddings measure the relatedness of text strings and are commonly used for search, clustering,\nrecommendations, and other similar scenarios.", + "required": true, + "schema": { + "$ref": "#/definitions/EmbeddingsOptions" + }, + "x-ms-parameter-location": "method" } } }