From 823d5cc4024e8e659bd3714ebfb18f67c492775e Mon Sep 17 00:00:00 2001 From: Tom Kail Date: Sun, 3 Nov 2024 11:08:31 +0000 Subject: [PATCH] Adds previous_text, next_text, previous_request_ids and next_request_ids --- .../TextToSpeech/TextToSpeechRequest.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/ElevenLabs/Packages/com.rest.elevenlabs/Runtime/TextToSpeech/TextToSpeechRequest.cs b/ElevenLabs/Packages/com.rest.elevenlabs/Runtime/TextToSpeech/TextToSpeechRequest.cs index 0beb36f..36fb321 100644 --- a/ElevenLabs/Packages/com.rest.elevenlabs/Runtime/TextToSpeech/TextToSpeechRequest.cs +++ b/ElevenLabs/Packages/com.rest.elevenlabs/Runtime/TextToSpeech/TextToSpeechRequest.cs @@ -21,7 +21,10 @@ public TextToSpeechRequest( OutputFormat outputFormat = OutputFormat.MP3_44100_128, int? optimizeStreamingLatency = null, Model model = null, - string previousText = null) + string previousText = null, + string nextText = null, + string[] previousRequestIds = null, + string[] nextRequestIds = null) { if (string.IsNullOrWhiteSpace(text)) { @@ -48,9 +51,12 @@ public TextToSpeechRequest( Model = model ?? Models.Model.MultiLingualV2; Voice = voice; VoiceSettings = voiceSettings ?? voice.Settings ?? throw new ArgumentNullException(nameof(voiceSettings)); - PreviousText = previousText; OutputFormat = outputFormat; OptimizeStreamingLatency = optimizeStreamingLatency; + PreviousText = previousText; + NextText = nextText; + PreviousRequestIds = previousRequestIds; + NextRequestIds = nextRequestIds; } [Preserve] @@ -69,10 +75,6 @@ public TextToSpeechRequest( [JsonProperty("voice_settings")] public VoiceSettings VoiceSettings { get; internal set; } - [Preserve] - [JsonProperty("previous_text")] - public string PreviousText { get; } - [Preserve] [JsonIgnore] public OutputFormat OutputFormat { get; } @@ -80,5 +82,23 @@ public TextToSpeechRequest( [Preserve] [JsonIgnore] public int? OptimizeStreamingLatency { get; } + + [Preserve] + [JsonProperty("previous_text")] + public string PreviousText { get; } + + [Preserve] + [JsonProperty("next_text")] + public string NextText { get; } + + [Preserve] + [JsonProperty("previous_request_ids")] + // Note: A maximum of three next or previous history item ids can be sent + public string[] PreviousRequestIds { get; } + + [Preserve] + [JsonProperty("next_request_ids")] + // Note: A maximum of three next or previous history item ids can be sent + public string[] NextRequestIds { get; } } }