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

ElevenLabs-DotNet 3.0.1 #58

Merged
merged 3 commits into from
Sep 2, 2024
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
4 changes: 3 additions & 1 deletion ElevenLabs-DotNet/ElevenLabs-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ All copyrights, trademarks, logos, and assets are the property of their respecti
<SignAssembly>false</SignAssembly>
<IncludeSymbols>true</IncludeSymbols>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
<PackageReleaseNotes>
Version 3.0.1
- Updated Models
Version 3.0.0
- Updated to .NET 8.0
- Added ability to specify fully customizable domain proxies
Expand Down
55 changes: 45 additions & 10 deletions ElevenLabs-DotNet/Models/Model.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

Expand All @@ -20,6 +21,10 @@ public Model(string id)
[JsonPropertyName("name")]
public string Name { get; private set; }

[JsonInclude]
[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonInclude]
[JsonPropertyName("can_be_finetuned")]
public bool CanBeFineTuned { get; private set; }
Expand All @@ -36,37 +41,67 @@ public Model(string id)
[JsonPropertyName("token_cost_factor")]
public double TokenCostFactor { get; private set; }

[JsonInclude]
[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonInclude]
[JsonPropertyName("languages")]
public IReadOnlyList<Language> Languages { get; private set; }

public static implicit operator string(Model model) => model.ToString();
public static implicit operator string(Model model) => model?.ToString();

public override string ToString() => Id;

#region Predefined Models

[JsonIgnore]
public static Model MonoLingualV1 { get; } = new("eleven_monolingual_v1");
[Obsolete("Use EnglishV1")]
public static Model MonoLingualV1 => EnglishV1;

[JsonIgnore]
public static Model MultiLingualV1 { get; } = new("eleven_multilingual_v1");
[Obsolete("use EnglishTurboV2")]
public static Model TurboV2 => EnglishTurboV2;

/// <summary>
/// Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).
/// </summary>
[JsonIgnore]
public static Model MultiLingualV2 { get; } = new("eleven_multilingual_v2");
public static Model EnglishV1 { get; } = new("eleven_monolingual_v1");

/// <summary>
/// Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.
/// </summary>
[JsonIgnore]
public static Model EnglishTurboV2 { get; } = new("eleven_turbo_v2");

/// <summary>
/// Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.
/// </summary>
[JsonIgnore]
public static Model TurboV2_5 { get; } = new("eleven_turbo_v2_5");

/// <summary>
/// Our first Multilingual model, capability of generating speech in 10 languages.
/// Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).
/// </summary>
[JsonIgnore]
public static Model TurboV2 { get; } = new("eleven_turbo_v2");
public static Model MultiLingualV1 { get; } = new("eleven_multilingual_v1");

/// <summary>
/// Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.
/// </summary>
[JsonIgnore]
public static Model MultiLingualV2 { get; } = new("eleven_multilingual_v2");

/// <summary>
/// Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.
/// </summary>
[JsonIgnore]
public static Model EnglishSpeechToSpeechV2 { get; } = new("eleven_english_sts_v2");

/// <summary>
/// Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both
/// the content and the prosody of the generated speech across various languages.
/// </summary>
[JsonIgnore]
public static Model MultilingualSpeechToSpeechV2 { get; } = new("eleven_multilingual_sts_v2");
public static Model MultiLingualSpeechToSpeechV2 { get; } = new("eleven_multilingual_sts_v2");

#endregion Predefined Models
}
Expand Down
2 changes: 1 addition & 1 deletion ElevenLabs-DotNet/TextToSpeech/TextToSpeechRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public TextToSpeechRequest(string text, Model model, VoiceSettings voiceSettings
}

Text = text;
Model = model ?? Models.Model.MonoLingualV1;
Model = model ?? Models.Model.EnglishV1;
VoiceSettings = voiceSettings ?? throw new ArgumentNullException(nameof(voiceSettings));
}

Expand Down