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

Support for all multiple generation API features #98

Closed
Closed
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 @@ -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))
{
Expand All @@ -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]
Expand All @@ -69,16 +75,30 @@ 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; }

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