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 promptAudio)
Parameters
Type |
Name |
Description |
AudioClip |
promptAudio |
|
Returns
GENAudioIsolation(AudioSource)
Declaration
public static GENAudioIsolationTask GENAudioIsolation(this AudioSource target)
Parameters
Type |
Name |
Description |
AudioSource |
target |
|
Returns
GENChat(ChatSession, ChatMessage)
Creates a text generation task using this chat session and message as the prompt.
Example:
chatSession.GENChat(chatMessage).SetModel(OpenAIModel.GPT4o).ExecuteAsync();
Declaration
public static GENChatTask GENChat(this ChatSession chatSession, ChatMessage chatMessage)
Parameters
Returns
GENImage(Image, 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 Image target, string promptText)
Parameters
Type |
Name |
Description |
Image |
target |
|
string |
promptText |
|
Returns
GENImage(RawImage, 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 RawImage target, string promptText)
Parameters
Type |
Name |
Description |
RawImage |
target |
|
string |
promptText |
|
Returns
GENImage(SpriteRenderer, 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 SpriteRenderer target, string promptText)
Parameters
Type |
Name |
Description |
SpriteRenderer |
target |
|
string |
promptText |
|
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 promptText)
Parameters
Type |
Name |
Description |
string |
promptText |
|
Returns
GENImageEdit(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 GENImageEdit(this InpaintPrompt prompt)
Parameters
Returns
GENImageEdit(Image, string)
Declaration
public static GENInpaintTask GENImageEdit(this Image target, string inpaintInstruction)
Parameters
Type |
Name |
Description |
Image |
target |
|
string |
inpaintInstruction |
|
Returns
GENImageEdit(RawImage, string)
Declaration
public static GENInpaintTask GENImageEdit(this RawImage target, string inpaintInstruction)
Parameters
Type |
Name |
Description |
RawImage |
target |
|
string |
inpaintInstruction |
|
Returns
GENImageEdit(SpriteRenderer, string)
Declaration
public static GENInpaintTask GENImageEdit(this SpriteRenderer target, string inpaintInstruction)
Parameters
Type |
Name |
Description |
SpriteRenderer |
target |
|
string |
inpaintInstruction |
|
Returns
GENImageVariation(Image)
Declaration
public static GENImageVariationTask GENImageVariation(this Image target)
Parameters
Type |
Name |
Description |
Image |
target |
|
Returns
GENImageVariation(RawImage)
Declaration
public static GENImageVariationTask GENImageVariation(this RawImage target)
Parameters
Type |
Name |
Description |
RawImage |
target |
|
Returns
GENImageVariation(SpriteRenderer)
Declaration
public static GENImageVariationTask GENImageVariation(this SpriteRenderer target)
Parameters
Type |
Name |
Description |
SpriteRenderer |
target |
|
Returns
GENImageVariation(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 GENImageVariation(this Texture2D prompt)
Parameters
Type |
Name |
Description |
Texture2D |
prompt |
|
Returns
GENInpaint(Texture2D, string)
Declaration
public static GENInpaintTask GENInpaint(this Texture2D promptImage, string inpaintInstruction)
Parameters
Type |
Name |
Description |
Texture2D |
promptImage |
|
string |
inpaintInstruction |
|
Returns
GENModeration(Content, 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 Content prompt, IEnumerable<SafetySetting> safetySettings)
Parameters
Type |
Name |
Description |
Content |
prompt |
The content to be evaluated for moderation.
|
IEnumerable<SafetySetting> |
safetySettings |
|
Returns
GENObject<T>(string)
Declaration
public static GENObjectTask<T> GENObject<T>(this string promptText)
Parameters
Type |
Name |
Description |
string |
promptText |
|
Returns
Type Parameters
GENSoundEffect(AudioSource, string)
Generates a sound effect based on this prompt text.
Example:
"Footsteps on snow".GENSoundEffect().ExecuteAsync();
Declaration
public static GENSoundEffectTask GENSoundEffect(this AudioSource target, string promptText)
Parameters
Type |
Name |
Description |
AudioSource |
target |
|
string |
promptText |
|
Returns
GENSoundEffect(string)
Generates a sound effect based on this prompt text.
Example:
"Footsteps on snow".GENSoundEffect().ExecuteAsync();
Declaration
public static GENSoundEffectTask GENSoundEffect(this string promptText)
Parameters
Type |
Name |
Description |
string |
promptText |
|
Returns
GENSpeech(AudioSource, 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 AudioSource target, string promptText)
Parameters
Type |
Name |
Description |
AudioSource |
target |
|
string |
promptText |
|
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 promptText)
Parameters
Type |
Name |
Description |
string |
promptText |
|
Returns
GENText(string)
Creates a text‑generation task that uses this string as the prompt.
Declaration
public static GENTextTask GENText(this string promptText)
Parameters
Type |
Name |
Description |
string |
promptText |
The prompt to send to the model.
|
Returns
Examples
"Tell me a joke."
.GENText()
.SetModel(OpenAIModel.GPT4o)
.ExecuteAsync();
GENText(Text, string)
Creates a text‑generation task that uses this string as the prompt.
Declaration
public static GENTextTask GENText(this Text target, string promptText)
Parameters
Type |
Name |
Description |
Text |
target |
|
string |
promptText |
The prompt to send to the model.
|
Returns
Examples
"Tell me a joke."
.GENText()
.SetModel(OpenAIModel.GPT4o)
.ExecuteAsync();
GENText(TextMesh, string)
Creates a text‑generation task that uses this string as the prompt.
Declaration
public static GENTextTask GENText(this TextMesh target, string promptText)
Parameters
Type |
Name |
Description |
TextMesh |
target |
|
string |
promptText |
The prompt to send to the model.
|
Returns
Examples
"Tell me a joke."
.GENText()
.SetModel(OpenAIModel.GPT4o)
.ExecuteAsync();
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 promptAudio)
Parameters
Type |
Name |
Description |
AudioClip |
promptAudio |
|
Returns
GENTranscript(Text, AudioClip)
Declaration
public static GENTranscriptTask GENTranscript(this Text target, AudioClip promptAudio)
Parameters
Type |
Name |
Description |
Text |
target |
|
AudioClip |
promptAudio |
|
Returns
GENTranscript(TextMesh, AudioClip)
Declaration
public static GENTranscriptTask GENTranscript(this TextMesh target, AudioClip promptAudio)
Parameters
Type |
Name |
Description |
TextMesh |
target |
|
AudioClip |
promptAudio |
|
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 promptAudio)
Parameters
Type |
Name |
Description |
AudioClip |
promptAudio |
|
Returns
GENTranslation(Text, AudioClip)
Declaration
public static GENTranslationTask GENTranslation(this Text target, AudioClip promptAudio)
Parameters
Type |
Name |
Description |
Text |
target |
|
AudioClip |
promptAudio |
|
Returns
GENTranslation(TextMesh, AudioClip)
Declaration
public static GENTranslationTask GENTranslation(this TextMesh target, AudioClip promptAudio)
Parameters
Type |
Name |
Description |
TextMesh |
target |
|
AudioClip |
promptAudio |
|
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 promptText)
Parameters
Type |
Name |
Description |
string |
promptText |
|
Returns
GENVideo(Texture2D)
Generates a video based on this prompt image.
Example:
texture.GENVideoGen().ExecuteAsync();
Declaration
public static GENVideoTask GENVideo(this Texture2D promptImage)
Parameters
Type |
Name |
Description |
Texture2D |
promptImage |
|
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 promptAudio)
Parameters
Type |
Name |
Description |
AudioClip |
promptAudio |
|
Returns
GENVoiceChange(AudioSource)
Declaration
public static GENVoiceChangeTask GENVoiceChange(this AudioSource target)
Parameters
Type |
Name |
Description |
AudioSource |
target |
|
Returns