Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static partial class AudioCreateSpeechAsEventStreamCommandApiCommand
private static Option<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.VoiceIdsShared?, global::tryAGI.OpenAI.CreateSpeechRequestVoice?>?, global::tryAGI.OpenAI.CreateSpeechRequestVoice2>> Voice { get; } = new(
name: @"--voice")
{
Description = @"The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ ""id"": ""voice_1234"" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).",
Description = @"The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ ""id"": ""voice_1234"" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.",
Required = true,
};
private static readonly CreateSpeechRequestOptionSet CreateSpeechRequestOptionSetOptions = CreateSpeechRequestOptionSet.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static partial class AudioCreateSpeechCommandApiCommand
private static Option<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.VoiceIdsShared?, global::tryAGI.OpenAI.CreateSpeechRequestVoice?>?, global::tryAGI.OpenAI.CreateSpeechRequestVoice2>> Voice { get; } = new(
name: @"--voice")
{
Description = @"The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ ""id"": ""voice_1234"" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).",
Description = @"The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ ""id"": ""voice_1234"" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.",
Required = true,
};
private static readonly CreateSpeechRequestOptionSet CreateSpeechRequestOptionSetOptions = CreateSpeechRequestOptionSet.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public static Command Create(string? commandName = null)
var command = new Command(commandName ?? @"create-voice", @"Create voice
Creates a voice from a text prompt or from a consent recording and an audio sample.

For prompt-based creation, send `type: ""prompt""` with a `name` and `prompt` as JSON or multipart form data. Consent-based creation requires multipart form data and is the default when `type` is omitted.
For prompt-based creation, send `type: ""prompt""` with a `name` and `prompt` as JSON or multipart form data. For creation from an audio sample, send `type: ""audio_sample""` with a `name`, `audio_sample`, and `consent` recording ID as multipart form data. The type defaults to `audio_sample` when omitted.

Returns the saved voice's metadata. Use the voice ID in supported audio output endpoints. The response does not include preview audio.
Returns the saved voice's metadata. Voices created from text prompts are supported only in Live, not in Realtime or the speech endpoint. The response does not include preview audio.
");
command.Arguments.Add(NameOption);
command.Options.Add(Type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set this to [""text""].
`marin`, and `cedar`. You may also provide a custom voice object with an
`id`, for example `{ ""id"": ""voice_1234"" }`. Voice cannot be changed during
the session once the model has responded with audio at least once.
Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.
",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public sealed partial class RealtimeResponseCreateParamsAudioOutput
/// `marin`, and `cedar`. You may also provide a custom voice object with<br/>
/// an `id`, for example `{ "id": "voice_1234" }`. Voice cannot be changed<br/>
/// during the session once the model has responded with audio at least once.<br/>
/// Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.<br/>
/// We recommend `marin` and `cedar` for best quality.<br/>
/// Default Value: alloy
/// </summary>
Expand All @@ -46,6 +47,7 @@ public sealed partial class RealtimeResponseCreateParamsAudioOutput
/// `marin`, and `cedar`. You may also provide a custom voice object with<br/>
/// an `id`, for example `{ "id": "voice_1234" }`. Voice cannot be changed<br/>
/// during the session once the model has responded with audio at least once.<br/>
/// Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.<br/>
/// We recommend `marin` and `cedar` for best quality.<br/>
/// Default Value: alloy
/// </param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public sealed partial class RealtimeSessionCreateRequestGAAudioOutput
/// `marin`, and `cedar`. You may also provide a custom voice object with<br/>
/// an `id`, for example `{ "id": "voice_1234" }`. Voice cannot be changed<br/>
/// during the session once the model has responded with audio at least once.<br/>
/// Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.<br/>
/// We recommend `marin` and `cedar` for best quality.<br/>
/// Default Value: alloy
/// </summary>
Expand Down Expand Up @@ -56,6 +57,7 @@ public sealed partial class RealtimeSessionCreateRequestGAAudioOutput
/// `marin`, and `cedar`. You may also provide a custom voice object with<br/>
/// an `id`, for example `{ "id": "voice_1234" }`. Voice cannot be changed<br/>
/// during the session once the model has responded with audio at least once.<br/>
/// Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.<br/>
/// We recommend `marin` and `cedar` for best quality.<br/>
/// Default Value: alloy
/// </param>
Expand Down
141 changes: 141 additions & 0 deletions src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.5.Json.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#nullable enable

namespace tryAGI.OpenAI
{
public readonly partial struct AnyOf<T1, T2, T3, T4, T5>
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
/// </summary>
public string ToJson()
{
return ToJson(global::tryAGI.OpenAI.SourceGenerationContext.Default);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return ToJson(global::tryAGI.OpenAI.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>),
jsonSerializerContext) as global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>?;
}

/// <summary>
/// Deserializes a JSON string using the generated default JsonSerializerContext.
/// </summary>
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>? FromJson(
string json)
{
return FromJson(
json,
global::tryAGI.OpenAI.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJson(
json,
global::tryAGI.OpenAI.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>),
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>?;
}

/// <summary>
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
/// </summary>
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream)
{
return FromJsonStreamAsync(
jsonStream,
global::tryAGI.OpenAI.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJsonStreamAsync(
jsonStream,
global::tryAGI.OpenAI.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5>?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Loading
Loading