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] Refactor project structure #25986

Merged
merged 8 commits into from
Oct 10, 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
2 changes: 2 additions & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@ findsquare
finetune
finetunes
firmwares
flac
flexera
flink
flowlet
Expand Down Expand Up @@ -1644,6 +1645,7 @@ moodle
mooncake
mountainview
movere
mpga
mpls
mpns
mran
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2023-09-01-preview",
"deploymentId": "<deployment-id>"
"deploymentId": "<deployment-id>",
"body": "---multipart-boundary\nContent-Disposition: form-data; name=\"file\"; filename=\"file.wav\"\nContent-Type: application/octet-stream\n\nRIFF..audio.data.omitted\n---multipart-boundary--"
},
"responses": {
"200": {
Expand Down
19 changes: 6 additions & 13 deletions specification/cognitiveservices/OpenAI.Inference/main.tsp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import "@typespec/rest";
import "@typespec/http";
import "@typespec/versioning";

import "./routes.tsp";
import "./routes/common.tsp";
import "./routes/audio_transcription.tsp";
import "./routes/audio_translation.tsp";
import "./routes/completions.tsp";
import "./routes/images.tsp";
import "./routes/embeddings.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;

#suppress "@azure-tools/typespec-azure-core/casing-style" "OpenAI is a case-sensitive name"
Expand Down Expand Up @@ -56,13 +59,3 @@ enum ServiceApiVersions {
@useDependency(Azure.Core.Versions.v1_0_Preview_1)
v2023_09_01_Preview: "2023-09-01-preview",
}

@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;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@typespec/versioning";
import "./audio.common.tsp";
import "./common.tsp";

namespace Azure.OpenAI;

Expand Down Expand Up @@ -36,7 +36,7 @@ The configuration information for an audio transcription request.
model AudioTranscriptionOptions {
@doc("""
The audio data to transcribe. This must be the binary content of a file in one of the supported media formats:
flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
""")
@projectedName("csharp", "AudioData")
file: bytes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@typespec/versioning";
import "./audio.common.tsp";
import "./common.tsp";

namespace Azure.OpenAI;

Expand Down Expand Up @@ -36,7 +36,7 @@ The configuration information for an audio translation request.
model AudioTranslationOptions {
@doc("""
The audio data to translate. This must be the binary content of a file in one of the supported media formats:
flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
""")
@projectedName("csharp", "AudioData")
file: bytes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "@typespec/versioning";
import "./chat.completions.tsp";
import "./azure.cognitive.search.options.tsp";

import "./chat_completions.tsp";
import "./azure_cognitive_search_options.tsp";

namespace Azure.OpenAI;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "@typespec/versioning";
import "./azure.chat.extensions.tsp";

import "./azure_chat_extensions.tsp";

namespace Azure.OpenAI;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import "@typespec/rest";
import "@typespec/http";
import "@typespec/versioning";
import "./azure.chat.extensions.tsp";
import "./completions.common.tsp";

import "./azure_chat_extensions.tsp";
import "./common.tsp";
import "./functions.tsp";

using TypeSpec.Rest;
Expand Down Expand Up @@ -231,8 +232,8 @@ model ChatChoice {
delta?: ChatMessage;

@doc("""
Information about the content filtering category (hate, sexual, violence, self_harm), if it
has been detected, as well as the severity level (very_low, low, medium, high-scale that
Information about the content filtering category (hate, sexual, violence, self_harm), if it
has been detected, as well as the severity level (very_low, low, medium, high-scale that
determines the intensity and risk level of harmful content) and if it has been filtered or not.
""")
@added(ServiceApiVersions.v2023_06_01_Preview)
Expand Down Expand Up @@ -268,7 +269,7 @@ model ChatCompletions {
choices: ChatChoice[];

@doc("""
Content filtering results for zero or more prompts in the request. In a streaming request,
Content filtering results for zero or more prompts in the request. In a streaming request,
results for different prompts may arrive at different times or in different orders.
""")
@added(ServiceApiVersions.v2023_06_01_Preview)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import "@typespec/rest";
import "@typespec/http";
import "@typespec/versioning";
import "./completions.common.tsp";

import "./common.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
Expand Down Expand Up @@ -163,7 +164,7 @@ model Completions {
created: utcDateTime;

@doc("""
Content filtering results for zero or more prompts in the request. In a streaming request,
Content filtering results for zero or more prompts in the request. In a streaming request,
results for different prompts may arrive at different times or in different orders.
""")
@added(ServiceApiVersions.v2023_06_01_Preview)
Expand Down Expand Up @@ -200,8 +201,8 @@ model Choice {
index: int32;

@doc("""
Information about the content filtering category (hate, sexual, violence, self_harm), if it
has been detected, as well as the severity level (very_low, low, medium, high-scale that
Information about the content filtering category (hate, sexual, violence, self_harm), if it
has been detected, as well as the severity level (very_low, low, medium, high-scale that
determines the intensity and risk level of harmful content) and if it has been filtered or not.
""")
@added(ServiceApiVersions.v2023_06_01_Preview)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import "@azure-tools/typespec-azure-core";
import "@typespec/http";
import "@typespec/versioning";
import "./operations.common.tsp";

import "./common.tsp";

using Azure.Core;
using TypeSpec.Http;
Expand Down
180 changes: 0 additions & 180 deletions specification/cognitiveservices/OpenAI.Inference/routes.tsp

This file was deleted.

Loading