Skip to content

Commit

Permalink
[OpenAI.Inference] Change indent from 4 to 2 spaces for Windows compat (
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder authored and jnlycklama committed Nov 8, 2023
1 parent a31144c commit f4dadc7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
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
>;
22 changes: 11 additions & 11 deletions specification/cognitiveservices/OpenAI.Inference/routes/images.tsp
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
>;

0 comments on commit f4dadc7

Please sign in to comment.