Class GENTaskExtensions
Provides fluent, chainable extension methods that create and configure AI generation tasks.
These helpers let you start a task directly from the host object (string, AudioClip, Texture2D, etc.)
and then continue the configuration via the task's fluent API.
Typical usage:
// Create a chat-like text generation
"Describe a cat playing piano."
.GENText()
.SetModel(OpenAIModel.GPT4o)
.ExecuteAsync();
// Transcribe recorded speech
audioClip.GENTranscript().ExecuteAsync();
Inheritance
object
GENTaskExtensions
Assembly: .dll
Syntax
public static class GENTaskExtensions
Methods
GENAudioIsolation(AudioClip)
Isolates vocals or removes background noise from this audio clip.
Example:
audioClip.GENAudioIsolation().ExecuteAsync();
Declaration
public static GENAudioIsolationTask GENAudioIsolation(this AudioClip prompt)
Parameters
Type |
Name |
Description |
AudioClip |
prompt |
|
Returns
GENImage(string)
Creates an image generation task using this string as the image prompt.
Example:
"A cat surfing a wave".GENImage().SetModel(ImageModel.DallE3).ExecuteAsync();
Declaration
public static GENImageTask GENImage(this string prompt)
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
GENInpaint(InpaintPrompt)
Creates an image editing task by applying the given prompt to this image.
Note:
- DALL·E 3 image editing is not supported with the OpenAI API yet. (Only available in ChatGPT)
Example:
texture.GENImageEdit("Add sunglasses").SetModel(ImageModel.DallE2).ExecuteAsync();
Declaration
public static GENInpaintTask GENInpaint(this InpaintPrompt prompt)
Parameters
Returns
GENInpaint(Sprite, string)
Declaration
public static GENInpaintTask GENInpaint(this Sprite prompt, string instruction)
Parameters
Type |
Name |
Description |
Sprite |
prompt |
|
string |
instruction |
|
Returns
GENInpaint(Texture2D, string)
Declaration
public static GENInpaintTask GENInpaint(this Texture2D prompt, string instruction)
Parameters
Type |
Name |
Description |
Texture2D |
prompt |
|
string |
instruction |
|
Returns
GENModeration(string, IEnumerable<SafetySetting>)
Creates a moderation task to evaluate potentially harmful or sensitive content.
This can be used to detect categories like hate speech, violence, self-harm, etc.,
depending on the model and provider.
Example:
content.GENModeration().SetModel(OpenAIModel.Moderation).ExecuteAsync();
Declaration
public static GENModerationTask GENModeration(this string prompt, IEnumerable<SafetySetting> safetySettings)
Parameters
Type |
Name |
Description |
string |
prompt |
The content to be evaluated for moderation.
|
IEnumerable<SafetySetting> |
safetySettings |
|
Returns
GENObject<T>(string)
Declaration
[Obsolete("Use GENStruct instead.")]
public static GENStructTask<T> GENObject<T>(this string prompt) where T : class
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
Type Parameters
GENResponse(string)
Creates a text‑generation task that uses this string as the prompt.
Declaration
public static GENResponseTask GENResponse(this string prompt)
Parameters
Type |
Name |
Description |
string |
prompt |
The prompt to send to the model.
|
Returns
Examples
"Tell me a joke."
.GENText()
.SetModel(OpenAIModel.GPT4o)
.ExecuteAsync();
GENSoundEffect(string)
Generates a sound effect based on this prompt text.
Example:
"Footsteps on snow".GENSoundEffect().ExecuteAsync();
Declaration
public static GENSoundEffectTask GENSoundEffect(this string prompt)
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
GENSpeech(string)
Creates a text-to-speech (TTS) task that reads this string aloud using a realistic AI voice.
Example:
"Hello there!".GENSpeech().SetVoice(ElevenLabsVoice.Rachel).ExecuteAsync();
Declaration
public static GENSpeechTask GENSpeech(this string prompt)
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
GENStruct<T>(string)
Declaration
public static GENStructTask<T> GENStruct<T>(this string prompt) where T : class
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
Type Parameters
GENText(string)
Declaration
[Obsolete("Use GENResponse instead.")]
public static GENResponseTask GENText(this string prompt)
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
GENTranscript(AudioClip)
Creates a speech-to-text (STT) task that transcribes spoken words from this audio clip.
Example:
audioClip.GENTranscript().ExecuteAsync();
Declaration
public static GENTranscriptTask GENTranscript(this AudioClip prompt)
Parameters
Type |
Name |
Description |
AudioClip |
prompt |
|
Returns
GENTranslation(AudioClip)
Translates the speech in this audio clip into English text.
Useful for multilingual voice input.
Example:
audioClip.GENTranslation().ExecuteAsync();
Declaration
public static GENTranslationTask GENTranslation(this AudioClip prompt)
Parameters
Type |
Name |
Description |
AudioClip |
prompt |
|
Returns
GENVariation(Sprite)
Declaration
public static GENImageVariationTask GENVariation(this Sprite prompt)
Parameters
Type |
Name |
Description |
Sprite |
prompt |
|
Returns
GENVariation(Texture2D)
Creates a task to generate variations (remixes) of the given image.
Note:
- DALL·E 3 image variation is not supported with the OpenAI API yet. (Only available in ChatGPT)
Example:
texture.GENImageVariation().SetModel(ImageModel.DallE2).ExecuteAsync();
Declaration
public static GENImageVariationTask GENVariation(this Texture2D prompt)
Parameters
Type |
Name |
Description |
Texture2D |
prompt |
|
Returns
GENVideo(string)
Generates a video based on this prompt text.
Example:
"A cat surfing a wave".GENVideoGen().ExecuteAsync();
Declaration
public static GENVideoTask GENVideo(this string prompt)
Parameters
Type |
Name |
Description |
string |
prompt |
|
Returns
GENVideo(Texture2D)
Generates a video based on this prompt image.
Example:
texture.GENVideoGen().ExecuteAsync();
Declaration
public static GENVideoTask GENVideo(this Texture2D prompt)
Parameters
Type |
Name |
Description |
Texture2D |
prompt |
|
Returns
GENVoiceChange(AudioClip)
Changes the voice in this audio clip using AI voice transformation.
Example:
audioClip.GENVoiceChange().SetVoice(ElevenLabsVoice.Rachel).ExecuteAsync();
Declaration
public static GENVoiceChangeTask GENVoiceChange(this AudioClip prompt)
Parameters
Type |
Name |
Description |
AudioClip |
prompt |
|
Returns