Skip to content

Commit 4110026

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#222)
Co-authored-by: github-actions[bot] <[email protected]>
1 parent df18a0c commit 4110026

File tree

568 files changed

+33516
-5757
lines changed

Some content is hidden

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

568 files changed

+33516
-5757
lines changed

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.cs

Lines changed: 232 additions & 83 deletions
Large diffs are not rendered by default.

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IRealtimeClient.CreateRealtimeClientSecret.g.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ namespace tryAGI.OpenAI
55
public partial interface IRealtimeClient
66
{
77
/// <summary>
8-
/// Create realtime session<br/>
9-
/// Create a Realtime session and client secret for either realtime or transcription.
8+
/// Create client secret<br/>
9+
/// Create a Realtime client secret with an associated session configuration.
1010
/// </summary>
1111
/// <param name="request"></param>
1212
/// <param name="cancellationToken">The token to cancel the operation with</param>
@@ -16,11 +16,14 @@ public partial interface IRealtimeClient
1616
global::System.Threading.CancellationToken cancellationToken = default);
1717

1818
/// <summary>
19-
/// Create realtime session<br/>
20-
/// Create a Realtime session and client secret for either realtime or transcription.
19+
/// Create client secret<br/>
20+
/// Create a Realtime client secret with an associated session configuration.
2121
/// </summary>
2222
/// <param name="expiresAfter">
23-
/// Configuration for the ephemeral token expiration.
23+
/// Configuration for the client secret expiration. Expiration refers to the time after which<br/>
24+
/// a client secret will no longer be valid for creating sessions. The session itself may<br/>
25+
/// continue after that time once started. A secret can be used to create multiple sessions<br/>
26+
/// until it expires.
2427
/// </param>
2528
/// <param name="session">
2629
/// Session configuration to use for the client secret. Choose either a realtime<br/>

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IRealtimeClient.CreateRealtimeSession.g.cs

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,55 @@ public partial interface IRealtimeClient
2929
/// a usable ephemeral API token that can be used to authenticate browser clients<br/>
3030
/// for the Realtime API.
3131
/// </summary>
32-
/// <param name="audio">
33-
/// Configuration for input and output audio.
34-
/// </param>
3532
/// <param name="clientSecret">
36-
/// Configuration options for the generated client secret.
33+
/// Ephemeral key returned by the API.
34+
/// </param>
35+
/// <param name="inputAudioFormat">
36+
/// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
3737
/// </param>
38-
/// <param name="include">
39-
/// Additional fields to include in server outputs.<br/>
40-
/// - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
38+
/// <param name="inputAudioTranscription">
39+
/// Configuration for input audio transcription, defaults to off and can be<br/>
40+
/// set to `null` to turn off once on. Input audio transcription is not native<br/>
41+
/// to the model, since the model consumes audio directly. Transcription runs<br/>
42+
/// asynchronously and should be treated as rough guidance<br/>
43+
/// rather than the representation understood by the model.
4144
/// </param>
4245
/// <param name="instructions">
4346
/// The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.<br/>
4447
/// Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session.
4548
/// </param>
46-
/// <param name="maxOutputTokens">
49+
/// <param name="maxResponseOutputTokens">
4750
/// Maximum number of output tokens for a single assistant response,<br/>
4851
/// inclusive of tool calls. Provide an integer between 1 and 4096 to<br/>
4952
/// limit output tokens, or `inf` for the maximum available tokens for a<br/>
5053
/// given model. Defaults to `inf`.
5154
/// </param>
52-
/// <param name="model">
53-
/// The Realtime model used for this session.
54-
/// </param>
55-
/// <param name="outputModalities">
55+
/// <param name="modalities">
5656
/// The set of modalities the model can respond with. To disable audio,<br/>
5757
/// set this to ["text"].
5858
/// </param>
59+
/// <param name="outputAudioFormat">
60+
/// The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
61+
/// </param>
5962
/// <param name="prompt">
6063
/// Reference to a prompt template and its variables. <br/>
6164
/// [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
6265
/// </param>
66+
/// <param name="speed">
67+
/// The speed of the model's spoken response. 1.0 is the default speed. 0.25 is<br/>
68+
/// the minimum speed. 1.5 is the maximum speed. This value can only be changed<br/>
69+
/// in between model turns, not while a response is in progress.<br/>
70+
/// Default Value: 1
71+
/// </param>
6372
/// <param name="temperature">
64-
/// Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.<br/>
65-
/// Default Value: 0.8
73+
/// Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
6674
/// </param>
6775
/// <param name="toolChoice">
68-
/// How the model chooses tools. Provide one of the string modes or force a specific<br/>
69-
/// function/MCP tool.<br/>
70-
/// Default Value: auto
76+
/// How the model chooses tools. Options are `auto`, `none`, `required`, or<br/>
77+
/// specify a function.
7178
/// </param>
7279
/// <param name="tools">
73-
/// Tools available to the model.
80+
/// Tools (functions) available to the model.
7481
/// </param>
7582
/// <param name="tracing">
7683
/// Configuration options for tracing. Set to null to disable tracing. Once<br/>
@@ -80,29 +87,35 @@ public partial interface IRealtimeClient
8087
/// </param>
8188
/// <param name="truncation">
8289
/// Controls how the realtime conversation is truncated prior to model inference.<br/>
83-
/// The default is `auto`. When set to `retention_ratio`, the server retains a<br/>
84-
/// fraction of the conversation tokens prior to the instructions.
90+
/// The default is `auto`.
91+
/// </param>
92+
/// <param name="turnDetection">
93+
/// Configuration for turn detection. Can be set to `null` to turn off. Server<br/>
94+
/// VAD means that the model will detect the start and end of speech based on<br/>
95+
/// audio volume and respond at the end of user speech.
8596
/// </param>
86-
/// <param name="type">
87-
/// The type of session to create. Always `realtime` for the Realtime API.
97+
/// <param name="voice">
98+
/// Example: ash
8899
/// </param>
89100
/// <param name="cancellationToken">The token to cancel the operation with</param>
90101
/// <exception cref="global::System.InvalidOperationException"></exception>
91102
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.RealtimeSessionCreateResponse> CreateRealtimeSessionAsync(
92-
global::tryAGI.OpenAI.AnyOf<string, global::tryAGI.OpenAI.RealtimeSessionCreateRequestModel?> model,
93-
global::tryAGI.OpenAI.RealtimeSessionCreateRequestAudio? audio = default,
94-
global::tryAGI.OpenAI.RealtimeSessionCreateRequestClientSecret? clientSecret = default,
95-
global::System.Collections.Generic.IList<global::tryAGI.OpenAI.RealtimeSessionCreateRequestIncludeItem>? include = default,
103+
global::tryAGI.OpenAI.RealtimeSessionCreateRequestClientSecret clientSecret,
104+
string? inputAudioFormat = default,
105+
global::tryAGI.OpenAI.RealtimeSessionCreateRequestInputAudioTranscription? inputAudioTranscription = default,
96106
string? instructions = default,
97-
global::tryAGI.OpenAI.AnyOf<int?, global::tryAGI.OpenAI.RealtimeSessionCreateRequestMaxOutputTokens?>? maxOutputTokens = default,
98-
global::System.Collections.Generic.IList<global::tryAGI.OpenAI.RealtimeSessionCreateRequestOutputModalitie>? outputModalities = default,
107+
global::tryAGI.OpenAI.AnyOf<int?, global::tryAGI.OpenAI.RealtimeSessionCreateRequestMaxResponseOutputTokens?>? maxResponseOutputTokens = default,
108+
global::System.Collections.Generic.IList<global::tryAGI.OpenAI.RealtimeSessionCreateRequestModalitie>? modalities = default,
109+
string? outputAudioFormat = default,
99110
global::tryAGI.OpenAI.Prompt2? prompt = default,
111+
double? speed = default,
100112
double? temperature = default,
101-
global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.ToolChoiceOptions?, global::tryAGI.OpenAI.ToolChoiceFunction, global::tryAGI.OpenAI.ToolChoiceMCP>? toolChoice = default,
102-
global::System.Collections.Generic.IList<global::tryAGI.OpenAI.ToolsItem4>? tools = default,
113+
string? toolChoice = default,
114+
global::System.Collections.Generic.IList<global::tryAGI.OpenAI.RealtimeSessionCreateRequestTool>? tools = default,
103115
global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.RealtimeSessionCreateRequestTracingEnum?, global::tryAGI.OpenAI.RealtimeSessionCreateRequestTracingEnum2>? tracing = default,
104116
global::tryAGI.OpenAI.RealtimeTruncation? truncation = default,
105-
global::tryAGI.OpenAI.RealtimeSessionCreateRequestType type = default,
117+
global::tryAGI.OpenAI.RealtimeSessionCreateRequestTurnDetection? turnDetection = default,
118+
global::tryAGI.OpenAI.VoiceIdsShared? voice = default,
106119
global::System.Threading.CancellationToken cancellationToken = default);
107120
}
108121
}

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IRealtimeClient.CreateRealtimeTranscriptionSession.g.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial interface IRealtimeClient
3131
/// </summary>
3232
/// <param name="include">
3333
/// The set of items to include in the transcription. Current available items are:<br/>
34-
/// - `item.input_audio_transcription.logprobs`
34+
/// `item.input_audio_transcription.logprobs`
3535
/// </param>
3636
/// <param name="inputAudioFormat">
3737
/// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.<br/>
@@ -44,29 +44,18 @@ public partial interface IRealtimeClient
4444
/// Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.<br/>
4545
/// Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.
4646
/// </param>
47-
/// <param name="inputAudioTranscription">
48-
/// Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
49-
/// </param>
50-
/// <param name="model">
51-
/// 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/>
52-
/// Example: gpt-4o-transcribe
53-
/// </param>
47+
/// <param name="inputAudioTranscription"></param>
5448
/// <param name="turnDetection">
5549
/// Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
5650
/// </param>
57-
/// <param name="type">
58-
/// The type of session to create. Always `transcription` for transcription sessions.
59-
/// </param>
6051
/// <param name="cancellationToken">The token to cancel the operation with</param>
6152
/// <exception cref="global::System.InvalidOperationException"></exception>
6253
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateResponse> CreateRealtimeTranscriptionSessionAsync(
63-
global::tryAGI.OpenAI.AnyOf<string, global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestModel?> model,
6454
global::System.Collections.Generic.IList<global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestIncludeItem>? include = default,
6555
global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioFormat? inputAudioFormat = default,
6656
global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction? inputAudioNoiseReduction = default,
67-
global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioTranscription? inputAudioTranscription = default,
57+
global::tryAGI.OpenAI.AudioTranscription? inputAudioTranscription = default,
6858
global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection? turnDetection = default,
69-
global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateRequestType type = default,
7059
global::System.Threading.CancellationToken cancellationToken = default);
7160
}
7261
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#nullable enable
2+
3+
namespace tryAGI.OpenAI.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class AudioTranscriptionModelJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.AudioTranscriptionModel>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.AudioTranscriptionModel Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::tryAGI.OpenAI.AudioTranscriptionModelExtensions.ToEnum(stringValue) ?? default;
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::tryAGI.OpenAI.AudioTranscriptionModel)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.AudioTranscriptionModel);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::tryAGI.OpenAI.AudioTranscriptionModel value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
writer.WriteStringValue(global::tryAGI.OpenAI.AudioTranscriptionModelExtensions.ToValueString(value));
51+
}
52+
}
53+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#nullable enable
2+
3+
namespace tryAGI.OpenAI.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class AudioTranscriptionModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.AudioTranscriptionModel?>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.AudioTranscriptionModel? Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::tryAGI.OpenAI.AudioTranscriptionModelExtensions.ToEnum(stringValue);
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::tryAGI.OpenAI.AudioTranscriptionModel)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.AudioTranscriptionModel?);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::tryAGI.OpenAI.AudioTranscriptionModel? value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
if (value == null)
51+
{
52+
writer.WriteNullValue();
53+
}
54+
else
55+
{
56+
writer.WriteStringValue(global::tryAGI.OpenAI.AudioTranscriptionModelExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#nullable enable
2+
3+
namespace tryAGI.OpenAI.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class NoiseReductionTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.NoiseReductionType>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.NoiseReductionType Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::tryAGI.OpenAI.NoiseReductionTypeExtensions.ToEnum(stringValue) ?? default;
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::tryAGI.OpenAI.NoiseReductionType)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.NoiseReductionType);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::tryAGI.OpenAI.NoiseReductionType value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
writer.WriteStringValue(global::tryAGI.OpenAI.NoiseReductionTypeExtensions.ToValueString(value));
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)