Skip to content

Commit f61ab37

Browse files
committed
fix: Update OpenAPI spec
1 parent 70b670c commit f61ab37

File tree

1,590 files changed

+134964
-42013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,590 files changed

+134964
-42013
lines changed

specs/openai.yaml

Lines changed: 9006 additions & 2992 deletions
Large diffs are not rendered by default.

src/libs/AutoSDK/Extensions/OpenApiSchemaExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public static bool IsArray(
4040
{
4141
schema = schema ?? throw new ArgumentNullException(nameof(schema));
4242

43-
return schema.Type == "array" ||
44-
schema.Type == null && schema.Items != null;
43+
return schema.Type is "array" or null &&
44+
schema.Items is not null;
4545
}
4646

4747
public static bool IsEnum(

src/libs/AutoSDK/Models/TypeData.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ public static string GetCSharpType(SchemaContext context)
233233

234234
(_, _) when context.Schema.IsArray() =>
235235
$"{context.Children.FirstOrDefault(x => x.Hint == Hint.ArrayItem)?.TypeData.CSharpTypeWithoutNullability}".AsArray(),
236-
236+
// Fallback if `items` property is missing (openai specification)
237+
("array", _) => "byte[]",
238+
237239
(_, _) when context.IsNamedAnyOfLike => $"global::{context.Settings.Namespace}.{context.Id}",
238240
(_, _) when context.IsDerivedClass => $"global::{context.Settings.Namespace}.{context.Id}",
239241

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
Location: /*
4+
/// </summary>
5+
public static implicit operator ModelIds(global::G.ModelIdsShared value) => new ModelIds(value);
6+
^^^^^^^^
7+
8+
*/
9+
AutoSDK.SourceGenerators\AutoSDK.SourceGenerators.SdkGenerator\G.Models.ModelIds.g.cs: (31,88)-(31,96),
10+
Message: The call is ambiguous between the following methods or properties: 'ModelIds.ModelIds(ModelIdsShared?)' and 'ModelIds.ModelIds(ModelIdsResponses?)',
11+
Severity: Error,
12+
Descriptor: {
13+
Id: CS0121,
14+
Title: ,
15+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0121),
16+
MessageFormat: The call is ambiguous between the following methods or properties: '{0}' and '{1}',
17+
Category: Compiler,
18+
DefaultSeverity: Error,
19+
IsEnabledByDefault: true,
20+
CustomTags: [
21+
Compiler,
22+
Telemetry,
23+
NotConfigurable
24+
]
25+
}
26+
},
27+
{
28+
Location: /*
29+
/// </summary>
30+
public static implicit operator ModelIds(global::G.ModelIdsResponses value) => new ModelIds(value);
31+
^^^^^^^^
32+
33+
*/
34+
AutoSDK.SourceGenerators\AutoSDK.SourceGenerators.SdkGenerator\G.Models.ModelIds.g.cs: (66,91)-(66,99),
35+
Message: The call is ambiguous between the following methods or properties: 'ModelIds.ModelIds(ModelIdsShared?)' and 'ModelIds.ModelIds(ModelIdsResponses?)',
36+
Severity: Error,
37+
Descriptor: {
38+
Id: CS0121,
39+
Title: ,
40+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0121),
41+
MessageFormat: The call is ambiguous between the following methods or properties: '{0}' and '{1}',
42+
Category: Compiler,
43+
DefaultSeverity: Error,
44+
IsEnabledByDefault: true,
45+
CustomTags: [
46+
Compiler,
47+
Telemetry,
48+
NotConfigurable
49+
]
50+
}
51+
}
52+
]

src/tests/AutoSDK.SnapshotTests/Snapshots/openai/NewtonsoftJson/_#G.AudioClient.CreateSpeech.g.verified.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,16 @@ partial void ProcessCreateSpeechResponseContent(
161161
/// Generates audio from the input text.
162162
/// </summary>
163163
/// <param name="model">
164-
/// One of the available [TTS models](/docs/models#tts): `tts-1` or `tts-1-hd`
164+
/// One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
165165
/// </param>
166166
/// <param name="input">
167167
/// The text to generate audio for. The maximum length is 4096 characters.
168168
/// </param>
169+
/// <param name="instructions">
170+
/// Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.
171+
/// </param>
169172
/// <param name="voice">
170-
/// The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech#voice-options).
173+
/// Example: ash
171174
/// </param>
172175
/// <param name="responseFormat">
173176
/// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.<br/>
@@ -182,7 +185,8 @@ partial void ProcessCreateSpeechResponseContent(
182185
public async global::System.Threading.Tasks.Task<byte[]> CreateSpeechAsync(
183186
global::G.AnyOf<string, global::G.CreateSpeechRequestModel?> model,
184187
string input,
185-
global::G.CreateSpeechRequestVoice voice,
188+
global::G.VoiceIdsShared voice,
189+
string? instructions = default,
186190
global::G.CreateSpeechRequestResponseFormat? responseFormat = default,
187191
double? speed = default,
188192
global::System.Threading.CancellationToken cancellationToken = default)
@@ -191,6 +195,7 @@ partial void ProcessCreateSpeechResponseContent(
191195
{
192196
Model = model,
193197
Input = input,
198+
Instructions = instructions,
194199
Voice = voice,
195200
ResponseFormat = responseFormat,
196201
Speed = speed,

src/tests/AutoSDK.SnapshotTests/Snapshots/openai/NewtonsoftJson/_#G.AudioClient.CreateTranscription.g.verified.cs

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,23 @@ partial void ProcessCreateTranscriptionResponseContent(
9999
content: new global::System.Net.Http.StringContent($"{request.Temperature}"),
100100
name: "temperature");
101101
}
102+
if (request.Include != default)
103+
{
104+
__httpRequestContent.Add(
105+
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Include, x => x.ToValueString()))}]"),
106+
name: "include[]");
107+
}
102108
if (request.TimestampGranularities != default)
103109
{
104110
__httpRequestContent.Add(
105111
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.TimestampGranularities, x => x.ToValueString()))}]"),
106112
name: "timestamp_granularities[]");
113+
}
114+
if (request.Stream != default)
115+
{
116+
__httpRequestContent.Add(
117+
content: new global::System.Net.Http.StringContent($"{request.Stream}"),
118+
name: "stream");
107119
}
108120
__httpRequest.Content = __httpRequestContent;
109121

@@ -209,8 +221,8 @@ partial void ProcessCreateTranscriptionResponseContent(
209221
/// The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
210222
/// </param>
211223
/// <param name="model">
212-
/// ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.<br/>
213-
/// Example: whisper-1
224+
/// ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model).<br/>
225+
/// Example: gpt-4o-transcribe
214226
/// </param>
215227
/// <param name="language">
216228
/// The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency.
@@ -219,17 +231,32 @@ partial void ProcessCreateTranscriptionResponseContent(
219231
/// An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language.
220232
/// </param>
221233
/// <param name="responseFormat">
222-
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
234+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`.<br/>
223235
/// Default Value: json
224236
/// </param>
225237
/// <param name="temperature">
226238
/// The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.<br/>
227239
/// Default Value: 0
228240
/// </param>
241+
/// <param name="include">
242+
/// Additional information to include in the transcription response. <br/>
243+
/// `logprobs` will return the log probabilities of the tokens in the <br/>
244+
/// response to understand the model's confidence in the transcription. <br/>
245+
/// `logprobs` only works with response_format set to `json` and only with <br/>
246+
/// the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`.
247+
/// </param>
229248
/// <param name="timestampGranularities">
230249
/// The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.<br/>
231250
/// Default Value: [segment]
232251
/// </param>
252+
/// <param name="stream">
253+
/// If set to true, the model response data will be streamed to the client<br/>
254+
/// as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). <br/>
255+
/// See the [Streaming section of the Speech-to-Text guide](/docs/guides/speech-to-text?lang=curl#streaming-transcriptions)<br/>
256+
/// for more information.<br/>
257+
/// Note: Streaming is not supported for the `whisper-1` model and will be ignored.<br/>
258+
/// Default Value: false
259+
/// </param>
233260
/// <param name="cancellationToken">The token to cancel the operation with</param>
234261
/// <exception cref="global::System.InvalidOperationException"></exception>
235262
public async global::System.Threading.Tasks.Task<global::G.OneOf<global::G.CreateTranscriptionResponseJson, global::G.CreateTranscriptionResponseVerboseJson>> CreateTranscriptionAsync(
@@ -240,7 +267,9 @@ partial void ProcessCreateTranscriptionResponseContent(
240267
string? prompt = default,
241268
global::G.AudioResponseFormat? responseFormat = default,
242269
double? temperature = default,
270+
global::System.Collections.Generic.IList<global::G.TranscriptionInclude>? include = default,
243271
global::System.Collections.Generic.IList<global::G.CreateTranscriptionRequestTimestampGranularitie>? timestampGranularities = default,
272+
bool? stream = default,
244273
global::System.Threading.CancellationToken cancellationToken = default)
245274
{
246275
var __request = new global::G.CreateTranscriptionRequest
@@ -252,7 +281,9 @@ partial void ProcessCreateTranscriptionResponseContent(
252281
Prompt = prompt,
253282
ResponseFormat = responseFormat,
254283
Temperature = temperature,
284+
Include = include,
255285
TimestampGranularities = timestampGranularities,
286+
Stream = stream,
256287
};
257288

258289
return await CreateTranscriptionAsync(

src/tests/AutoSDK.SnapshotTests/Snapshots/openai/NewtonsoftJson/_#G.AudioClient.CreateTranslation.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ partial void ProcessCreateTranslationResponseContent(
218218
string filename,
219219
global::G.AnyOf<string, global::G.CreateTranslationRequestModel?> model,
220220
string? prompt = default,
221-
global::G.AudioResponseFormat? responseFormat = default,
221+
global::G.CreateTranslationRequestResponseFormat? responseFormat = default,
222222
double? temperature = default,
223223
global::System.Threading.CancellationToken cancellationToken = default)
224224
{

src/tests/AutoSDK.SnapshotTests/Snapshots/openai/NewtonsoftJson/_#G.BatchClient.CreateBatch.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ partial void ProcessCreateBatchResponseContent(
175175
/// Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 200 MB in size.
176176
/// </param>
177177
/// <param name="endpoint">
178-
/// The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.
178+
/// The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.
179179
/// </param>
180180
/// <param name="completionWindow">
181181
/// The time frame within which the batch should be processed. Currently only `24h` is supported.

0 commit comments

Comments
 (0)