Sequence
Executing Multiple Tasks in Sequence
Sometimes you may want to run several generative tasks one after the other. For example, generate a piece of text, then use that text in a subsequent task, or just run a batch of independent tasks in order. GENSequence is a utility class to help with this.
Generating text then speech
Suppose we want to first generate a line of dialogue and then synthesize it into speech audio
var sequence = new GENSequence();
string lineResult = null; // to capture the text result of the first task
sequence.AppendText("Write a one-sentence line for a pirate character.".GENResponse())
.AppendTextToAudio(text => text.GENSpeech());
// Now execute the sequence
await sequence.ExecuteAsync();
Last updated