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; } } }