Skip to content

Commit

Permalink
ElevenLabs-DotNet 3.0.1 (#58)
Browse files Browse the repository at this point in the history
- updated models
  • Loading branch information
StephenHodgson authored Sep 2, 2024
1 parent 1f08fd3 commit e4955af
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 12 deletions.
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

0 comments on commit e4955af

Please sign in to comment.