Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenAI.Inference] Change indent from 4 to 2 spaces for Windows compat #26192

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ written language corresponding to the language it was spoken in.
@action("audio/transcriptions")
@sharedRoute
op getAudioTranscriptionAsPlainText is Azure.Core.Foundations.ResourceOperation<
Deployment,
AudioTranscriptionOptions, // response_format must be one of: text, srt, vtt
string,
MultipartFormDataRequestHeadersTraits
Deployment,
AudioTranscriptionOptions, // response_format must be one of: text, srt, vtt
string,
MultipartFormDataRequestHeadersTraits
>;

#suppress "@azure-tools/typespec-azure-core/byos" "representation of existing multipart/form-data operation"
Expand All @@ -43,8 +43,8 @@ written language corresponding to the language it was spoken in.
@action("audio/transcriptions")
@sharedRoute
op getAudioTranscriptionAsResponseObject is Azure.Core.ResourceAction<
Deployment,
AudioTranscriptionOptions, // response_format must be unspecified (json) or one of: json, verbose_json
AudioTranscription,
MultipartFormDataRequestHeadersTraits
Deployment,
AudioTranscriptionOptions, // response_format must be unspecified (json) or one of: json, verbose_json
AudioTranscription,
MultipartFormDataRequestHeadersTraits
>;
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Gets English language transcribed text and associated metadata from provided spo
@action("audio/translations")
@sharedRoute
op getAudioTranslationAsPlainText is Azure.Core.Foundations.ResourceOperation<
Deployment,
AudioTranslationOptions, // response_format must be one of: text, srt, vtt
string,
MultipartFormDataRequestHeadersTraits
Deployment,
AudioTranslationOptions, // response_format must be one of: text, srt, vtt
string,
MultipartFormDataRequestHeadersTraits
>;

#suppress "@azure-tools/typespec-azure-core/byos" "representation of existing multipart/form-data operation"
Expand All @@ -41,8 +41,8 @@ Gets English language transcribed text and associated metadata from provided spo
@action("audio/translations")
@sharedRoute
op getAudioTranslationAsResponseObject is Azure.Core.ResourceAction<
Deployment,
AudioTranslationOptions, // response_format must be unspecified (json) or one of: json, verbose_json
AudioTranslation,
MultipartFormDataRequestHeadersTraits
Deployment,
AudioTranslationOptions, // response_format must be unspecified (json) or one of: json, verbose_json
AudioTranslation,
MultipartFormDataRequestHeadersTraits
>;
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ using TypeSpec.Rest;
@doc("A specific deployment")
@TypeSpec.Rest.resource("deployments")
model Deployment {
@visibility("read")
@doc("Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.")
@projectedName("java", "deploymentOrModelName")
@key
deploymentId: string;
@visibility("read")
@doc("Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.")
@projectedName("java", "deploymentOrModelName")
@key
deploymentId: string;
}

// Audio implementation note: depending on the response_format provided in operation request bodies, these operations
Expand All @@ -26,7 +26,7 @@ model Deployment {
// that share common characteristics whenever possible.

alias MultipartFormDataRequestHeadersTraits = Azure.Core.Traits.RequestHeadersTrait<{
@doc("The content type for the operation. Always multipart/form-data for this operation.")
@header("content-type")
contentType: "multipart/form-data";
@doc("The content type for the operation. Always multipart/form-data for this operation.")
@header("content-type")
contentType: "multipart/form-data";
}>;
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ provided prompt data.
@actionSeparator("/")
@action("completions") //@convenientAPI(true)
op getCompletions is Azure.Core.ResourceAction<
Deployment,
CompletionsOptions,
Completions
Deployment,
CompletionsOptions,
Completions
>;

@doc("""
Expand All @@ -36,9 +36,9 @@ provided prompt data.
@actionSeparator("/")
@action("chat/completions") //@convenientAPI(true)
op getChatCompletions is ResourceAction<
Deployment,
ChatCompletionsOptions,
ChatCompletions
Deployment,
ChatCompletionsOptions,
ChatCompletions
>;

@doc("""
Expand All @@ -54,7 +54,7 @@ other augmentations to the base chat completions capabilities.
@actionSeparator("/")
@action("extensions/chat/completions")
op getChatCompletionsWithAzureExtensions is ResourceAction<
Deployment,
ChatCompletionsOptions,
ChatCompletions
Deployment,
ChatCompletionsOptions,
ChatCompletions
>;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Azure.OpenAI;
@actionSeparator("/")
@action("embeddings") //@convenientAPI(true)
op getEmbeddings is Azure.Core.ResourceAction<
Deployment,
EmbeddingsOptions,
Embeddings
Deployment,
EmbeddingsOptions,
Embeddings
>;
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ namespace Azure.OpenAI;
@added(ServiceApiVersions.v2023_06_01_Preview)
@route("/operations/images/{operationId}")
op getAzureBatchImageGenerationOperationStatus is RpcOperation<
{
@doc(".") @path operationId: string;
},
BatchImageGenerationOperationResponse
{
@doc(".") @path operationId: string;
},
BatchImageGenerationOperationResponse
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" ""
@doc("Starts the generation of a batch of images from a text caption")
@added(ServiceApiVersions.v2023_06_01_Preview)
@route("/images/generations:submit")
@pollingOperation(
getAzureBatchImageGenerationOperationStatus,
{
operationId: ResponseProperty<"id">,
}
getAzureBatchImageGenerationOperationStatus,
{
operationId: ResponseProperty<"id">,
}
)
op beginAzureBatchImageGeneration is OaiLongRunningRpcOperation<
ImageGenerationOptions,
BatchImageGenerationOperationResponse,
BatchImageGenerationOperationResponse
ImageGenerationOptions,
BatchImageGenerationOperationResponse,
BatchImageGenerationOperationResponse
>;