Skip to content

Commit aef0f29

Browse files
github-actions[bot]HavenDV
authored andcommitted
feat: Updated OpenAPI spec
1 parent c05598e commit aef0f29

12 files changed

+59
-58
lines changed

src/libs/OpenAI/Generated/JsonConverters.CreateTranscriptionRequestResponseFormat.g.cs renamed to src/libs/OpenAI/Generated/JsonConverters.AudioResponseFormat.g.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace OpenAI.JsonConverters
44
{
55
/// <inheritdoc />
6-
public sealed class CreateTranscriptionRequestResponseFormatJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.CreateTranscriptionRequestResponseFormat>
6+
public sealed class AudioResponseFormatJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.AudioResponseFormat>
77
{
88
/// <inheritdoc />
9-
public override global::OpenAI.CreateTranscriptionRequestResponseFormat Read(
9+
public override global::OpenAI.AudioResponseFormat Read(
1010
ref global::System.Text.Json.Utf8JsonReader reader,
1111
global::System.Type typeToConvert,
1212
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,15 +18,15 @@ public sealed class CreateTranscriptionRequestResponseFormatJsonConverter : glob
1818
var stringValue = reader.GetString();
1919
if (stringValue != null)
2020
{
21-
return global::OpenAI.CreateTranscriptionRequestResponseFormatExtensions.ToEnum(stringValue) ?? default;
21+
return global::OpenAI.AudioResponseFormatExtensions.ToEnum(stringValue) ?? default;
2222
}
2323

2424
break;
2525
}
2626
case global::System.Text.Json.JsonTokenType.Number:
2727
{
2828
var numValue = reader.GetInt32();
29-
return (global::OpenAI.CreateTranscriptionRequestResponseFormat)numValue;
29+
return (global::OpenAI.AudioResponseFormat)numValue;
3030
}
3131
default:
3232
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,12 +38,12 @@ public sealed class CreateTranscriptionRequestResponseFormatJsonConverter : glob
3838
/// <inheritdoc />
3939
public override void Write(
4040
global::System.Text.Json.Utf8JsonWriter writer,
41-
global::OpenAI.CreateTranscriptionRequestResponseFormat value,
41+
global::OpenAI.AudioResponseFormat value,
4242
global::System.Text.Json.JsonSerializerOptions options)
4343
{
4444
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
4545

46-
writer.WriteStringValue(global::OpenAI.CreateTranscriptionRequestResponseFormatExtensions.ToValueString(value));
46+
writer.WriteStringValue(global::OpenAI.AudioResponseFormatExtensions.ToValueString(value));
4747
}
4848
}
4949
}

src/libs/OpenAI/Generated/JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.cs renamed to src/libs/OpenAI/Generated/JsonConverters.AudioResponseFormatNullable.g.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace OpenAI.JsonConverters
44
{
55
/// <inheritdoc />
6-
public sealed class CreateTranscriptionRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.CreateTranscriptionRequestResponseFormat?>
6+
public sealed class AudioResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.AudioResponseFormat?>
77
{
88
/// <inheritdoc />
9-
public override global::OpenAI.CreateTranscriptionRequestResponseFormat? Read(
9+
public override global::OpenAI.AudioResponseFormat? Read(
1010
ref global::System.Text.Json.Utf8JsonReader reader,
1111
global::System.Type typeToConvert,
1212
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,15 +18,15 @@ public sealed class CreateTranscriptionRequestResponseFormatNullableJsonConverte
1818
var stringValue = reader.GetString();
1919
if (stringValue != null)
2020
{
21-
return global::OpenAI.CreateTranscriptionRequestResponseFormatExtensions.ToEnum(stringValue);
21+
return global::OpenAI.AudioResponseFormatExtensions.ToEnum(stringValue);
2222
}
2323

2424
break;
2525
}
2626
case global::System.Text.Json.JsonTokenType.Number:
2727
{
2828
var numValue = reader.GetInt32();
29-
return (global::OpenAI.CreateTranscriptionRequestResponseFormat)numValue;
29+
return (global::OpenAI.AudioResponseFormat)numValue;
3030
}
3131
default:
3232
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,7 +38,7 @@ public sealed class CreateTranscriptionRequestResponseFormatNullableJsonConverte
3838
/// <inheritdoc />
3939
public override void Write(
4040
global::System.Text.Json.Utf8JsonWriter writer,
41-
global::OpenAI.CreateTranscriptionRequestResponseFormat? value,
41+
global::OpenAI.AudioResponseFormat? value,
4242
global::System.Text.Json.JsonSerializerOptions options)
4343
{
4444
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
@@ -49,7 +49,7 @@ public override void Write(
4949
}
5050
else
5151
{
52-
writer.WriteStringValue(global::OpenAI.CreateTranscriptionRequestResponseFormatExtensions.ToValueString(value.Value));
52+
writer.WriteStringValue(global::OpenAI.AudioResponseFormatExtensions.ToValueString(value.Value));
5353
}
5454
}
5555
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ namespace OpenAI
163163
typeof(global::OpenAI.JsonConverters.CreateEmbeddingResponseObjectNullableJsonConverter),
164164
typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestModelJsonConverter),
165165
typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestModelNullableJsonConverter),
166-
typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter),
167-
typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestResponseFormatNullableJsonConverter),
166+
typeof(global::OpenAI.JsonConverters.AudioResponseFormatJsonConverter),
167+
typeof(global::OpenAI.JsonConverters.AudioResponseFormatNullableJsonConverter),
168168
typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestTimestampGranularitieJsonConverter),
169169
typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestTimestampGranularitieNullableJsonConverter),
170170
typeof(global::OpenAI.JsonConverters.CreateTranslationRequestModelJsonConverter),

src/libs/OpenAI/Generated/JsonSerializerContextTypes.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ public sealed partial class JsonSerializerContextTypes
961961
/// <summary>
962962
///
963963
/// </summary>
964-
public global::OpenAI.CreateTranscriptionRequestResponseFormat? Type237 { get; set; }
964+
public global::OpenAI.AudioResponseFormat? Type237 { get; set; }
965965
/// <summary>
966966
///
967967
/// </summary>

src/libs/OpenAI/Generated/OpenAI.AudioClient.CreateTranscription.g.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ partial void ProcessCreateTranscriptionResponseContent(
7272
content: new global::System.Net.Http.StringContent($"{request.Prompt}"),
7373
name: "prompt");
7474
}
75-
if (request.ResponseFormat != global::OpenAI.CreateTranscriptionRequestResponseFormat.Json)
75+
if (request.ResponseFormat != global::OpenAI.AudioResponseFormat.Json)
7676
{
7777
__httpRequestContent.Add(
7878
content: new global::System.Net.Http.StringContent($"{request.ResponseFormat?.ToValueString()}"),
@@ -157,7 +157,7 @@ partial void ProcessCreateTranscriptionResponseContent(
157157
/// 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.
158158
/// </param>
159159
/// <param name="responseFormat">
160-
/// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
160+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
161161
/// Default Value: json
162162
/// </param>
163163
/// <param name="temperature">
@@ -176,7 +176,7 @@ partial void ProcessCreateTranscriptionResponseContent(
176176
global::OpenAI.AnyOf<string, global::OpenAI.CreateTranscriptionRequestModel?> model,
177177
string? language = default,
178178
string? prompt = default,
179-
global::OpenAI.CreateTranscriptionRequestResponseFormat? responseFormat = global::OpenAI.CreateTranscriptionRequestResponseFormat.Json,
179+
global::OpenAI.AudioResponseFormat? responseFormat = global::OpenAI.AudioResponseFormat.Json,
180180
double? temperature = 0,
181181
global::System.Collections.Generic.IList<global::OpenAI.CreateTranscriptionRequestTimestampGranularitie>? timestampGranularities = default,
182182
global::System.Threading.CancellationToken cancellationToken = default)

src/libs/OpenAI/Generated/OpenAI.AudioClient.CreateTranslation.g.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ partial void ProcessCreateTranslationResponseContent(
6666
content: new global::System.Net.Http.StringContent($"{request.Prompt}"),
6767
name: "prompt");
6868
}
69-
if (request.ResponseFormat != "json")
69+
if (request.ResponseFormat != global::OpenAI.AudioResponseFormat.Json)
7070
{
7171
__httpRequestContent.Add(
72-
content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"),
72+
content: new global::System.Net.Http.StringContent($"{request.ResponseFormat?.ToValueString()}"),
7373
name: "response_format");
7474
}
7575
if (request.Temperature != 0)
@@ -142,7 +142,7 @@ partial void ProcessCreateTranslationResponseContent(
142142
/// An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
143143
/// </param>
144144
/// <param name="responseFormat">
145-
/// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
145+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
146146
/// Default Value: json
147147
/// </param>
148148
/// <param name="temperature">
@@ -156,7 +156,7 @@ partial void ProcessCreateTranslationResponseContent(
156156
string filename,
157157
global::OpenAI.AnyOf<string, global::OpenAI.CreateTranslationRequestModel?> model,
158158
string? prompt = default,
159-
string? responseFormat = "json",
159+
global::OpenAI.AudioResponseFormat? responseFormat = global::OpenAI.AudioResponseFormat.Json,
160160
double? temperature = 0,
161161
global::System.Threading.CancellationToken cancellationToken = default)
162162
{

src/libs/OpenAI/Generated/OpenAI.IAudioClient.CreateTranscription.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public partial interface IAudioClient
3434
/// 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.
3535
/// </param>
3636
/// <param name="responseFormat">
37-
/// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
37+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
3838
/// Default Value: json
3939
/// </param>
4040
/// <param name="temperature">
@@ -53,7 +53,7 @@ public partial interface IAudioClient
5353
global::OpenAI.AnyOf<string, global::OpenAI.CreateTranscriptionRequestModel?> model,
5454
string? language = default,
5555
string? prompt = default,
56-
global::OpenAI.CreateTranscriptionRequestResponseFormat? responseFormat = global::OpenAI.CreateTranscriptionRequestResponseFormat.Json,
56+
global::OpenAI.AudioResponseFormat? responseFormat = global::OpenAI.AudioResponseFormat.Json,
5757
double? temperature = 0,
5858
global::System.Collections.Generic.IList<global::OpenAI.CreateTranscriptionRequestTimestampGranularitie>? timestampGranularities = default,
5959
global::System.Threading.CancellationToken cancellationToken = default);

src/libs/OpenAI/Generated/OpenAI.IAudioClient.CreateTranslation.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial interface IAudioClient
3131
/// An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
3232
/// </param>
3333
/// <param name="responseFormat">
34-
/// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
34+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
3535
/// Default Value: json
3636
/// </param>
3737
/// <param name="temperature">
@@ -45,7 +45,7 @@ public partial interface IAudioClient
4545
string filename,
4646
global::OpenAI.AnyOf<string, global::OpenAI.CreateTranslationRequestModel?> model,
4747
string? prompt = default,
48-
string? responseFormat = "json",
48+
global::OpenAI.AudioResponseFormat? responseFormat = global::OpenAI.AudioResponseFormat.Json,
4949
double? temperature = 0,
5050
global::System.Threading.CancellationToken cancellationToken = default);
5151
}

src/libs/OpenAI/Generated/OpenAI.Models.CreateTranscriptionRequestResponseFormat.g.cs renamed to src/libs/OpenAI/Generated/OpenAI.Models.AudioResponseFormat.g.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
namespace OpenAI
55
{
66
/// <summary>
7-
/// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
7+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
88
/// Default Value: json
99
/// </summary>
10-
public enum CreateTranscriptionRequestResponseFormat
10+
public enum AudioResponseFormat
1111
{
1212
/// <summary>
1313
/// `json`, `text`, `srt`, `verbose_json`, or `vtt`.
@@ -34,35 +34,35 @@ public enum CreateTranscriptionRequestResponseFormat
3434
/// <summary>
3535
/// Enum extensions to do fast conversions without the reflection.
3636
/// </summary>
37-
public static class CreateTranscriptionRequestResponseFormatExtensions
37+
public static class AudioResponseFormatExtensions
3838
{
3939
/// <summary>
4040
/// Converts an enum to a string.
4141
/// </summary>
42-
public static string ToValueString(this CreateTranscriptionRequestResponseFormat value)
42+
public static string ToValueString(this AudioResponseFormat value)
4343
{
4444
return value switch
4545
{
46-
CreateTranscriptionRequestResponseFormat.Json => "json",
47-
CreateTranscriptionRequestResponseFormat.Text => "text",
48-
CreateTranscriptionRequestResponseFormat.Srt => "srt",
49-
CreateTranscriptionRequestResponseFormat.VerboseJson => "verbose_json",
50-
CreateTranscriptionRequestResponseFormat.Vtt => "vtt",
46+
AudioResponseFormat.Json => "json",
47+
AudioResponseFormat.Text => "text",
48+
AudioResponseFormat.Srt => "srt",
49+
AudioResponseFormat.VerboseJson => "verbose_json",
50+
AudioResponseFormat.Vtt => "vtt",
5151
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
5252
};
5353
}
5454
/// <summary>
5555
/// Converts an string to a enum.
5656
/// </summary>
57-
public static CreateTranscriptionRequestResponseFormat? ToEnum(string value)
57+
public static AudioResponseFormat? ToEnum(string value)
5858
{
5959
return value switch
6060
{
61-
"json" => CreateTranscriptionRequestResponseFormat.Json,
62-
"text" => CreateTranscriptionRequestResponseFormat.Text,
63-
"srt" => CreateTranscriptionRequestResponseFormat.Srt,
64-
"verbose_json" => CreateTranscriptionRequestResponseFormat.VerboseJson,
65-
"vtt" => CreateTranscriptionRequestResponseFormat.Vtt,
61+
"json" => AudioResponseFormat.Json,
62+
"text" => AudioResponseFormat.Text,
63+
"srt" => AudioResponseFormat.Srt,
64+
"verbose_json" => AudioResponseFormat.VerboseJson,
65+
"vtt" => AudioResponseFormat.Vtt,
6666
_ => null,
6767
};
6868
}

src/libs/OpenAI/Generated/OpenAI.Models.CreateTranscriptionRequest.g.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public sealed partial class CreateTranscriptionRequest
4646
public string? Prompt { get; set; }
4747

4848
/// <summary>
49-
/// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
49+
/// The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.<br/>
5050
/// Default Value: json
5151
/// </summary>
5252
[global::System.Text.Json.Serialization.JsonPropertyName("response_format")]
53-
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenAI.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter))]
54-
public global::OpenAI.CreateTranscriptionRequestResponseFormat? ResponseFormat { get; set; } = global::OpenAI.CreateTranscriptionRequestResponseFormat.Json;
53+
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenAI.JsonConverters.AudioResponseFormatJsonConverter))]
54+
public global::OpenAI.AudioResponseFormat? ResponseFormat { get; set; } = global::OpenAI.AudioResponseFormat.Json;
5555

5656
/// <summary>
5757
/// 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/>

0 commit comments

Comments
 (0)