Table of Contents

Class GenerativeTaskExtensions

Namespace
Glitch9.AIDevKit

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();
public static class GenerativeTaskExtensions
Inheritance
object
GenerativeTaskExtensions

Methods

GENAudioIsolation(AudioClip)

Isolates vocals or removes background noise from this audio clip.

Example: audioClip.GENAudioIsolation().ExecuteAsync();

public static GENAudioIsolationTask GENAudioIsolation(this AudioClip prompt)

Parameters

prompt AudioClip

Returns

GENAudioIsolationTask

GENCode(TextPrompt)

public static GENCodeTask GENCode(this TextPrompt prompt)

Parameters

prompt TextPrompt

Returns

GENCodeTask

GENCode(string, string)

public static GENCodeTask GENCode(this string prompt, string formattedPrompt = null)

Parameters

prompt string
formattedPrompt string

Returns

GENCodeTask

GENImage(TextPrompt)

public static GENImageTask GENImage(this TextPrompt prompt)

Parameters

prompt TextPrompt

Returns

GENImageTask

GENImage(string, string)

Creates an image generation task using this string as the image prompt.

Example: "A cat surfing a wave".GENImage().SetModel(ImageModel.DallE3).ExecuteAsync();

public static GENImageTask GENImage(this string prompt, string formattedPrompt = null)

Parameters

prompt string
formattedPrompt string

Returns

GENImageTask

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();

public static GENInpaintTask GENInpaint(this InpaintPrompt prompt)

Parameters

prompt InpaintPrompt

Returns

GENInpaintTask

GENInpaint(Sprite, string)

public static GENInpaintTask GENInpaint(this Sprite prompt, string instruction)

Parameters

prompt Sprite
instruction string

Returns

GENInpaintTask

GENInpaint(Texture2D, string)

public static GENInpaintTask GENInpaint(this Texture2D prompt, string instruction)

Parameters

prompt Texture2D
instruction string

Returns

GENInpaintTask

GENModeration(TextPrompt, IEnumerable<SafetySetting>)

public static GENModerationTask GENModeration(this TextPrompt prompt, IEnumerable<SafetySetting> safetySettings)

Parameters

prompt TextPrompt
safetySettings IEnumerable<SafetySetting>

Returns

GENModerationTask

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();

public static GENModerationTask GENModeration(this string prompt, IEnumerable<SafetySetting> safetySettings)

Parameters

prompt string

The content to be evaluated for moderation.

safetySettings IEnumerable<SafetySetting>

Returns

GENModerationTask

A GENModerationTask that can be configured and executed.

GENResponse(TextPrompt)

public static GENResponseTask GENResponse(this TextPrompt prompt)

Parameters

prompt TextPrompt

Returns

GENResponseTask

GENResponse(string, string)

Creates a text‑generation task that uses this string as the prompt.

public static GENResponseTask GENResponse(this string prompt, string formattedPrompt = null)

Parameters

prompt string

The prompt to send to the model.

formattedPrompt string

Returns

GENResponseTask

A configurable GENResponseTask instance.

Examples

"Tell me a joke."
    .GENText()
    .SetModel(OpenAIModel.GPT4o)
    .ExecuteAsync();

GENSoundEffect(Weighted<string>)

public static GENSoundEffectTask GENSoundEffect(this Weighted<string> prompt)

Parameters

prompt Weighted<string>

Returns

GENSoundEffectTask

GENSoundEffect(string)

Generates a sound effect based on this prompt text.

Example: "Footsteps on snow".GENSoundEffect().ExecuteAsync();

public static GENSoundEffectTask GENSoundEffect(this string prompt)

Parameters

prompt string

Returns

GENSoundEffectTask

GENSpeech(TextPrompt)

public static GENSpeechTask GENSpeech(this TextPrompt prompt)

Parameters

prompt TextPrompt

Returns

GENSpeechTask

GENSpeech(string, 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();

public static GENSpeechTask GENSpeech(this string prompt, string formattedPrompt = null)

Parameters

prompt string
formattedPrompt string

Returns

GENSpeechTask

GENStruct<T>(TextPrompt)

public static GENStructTask<T> GENStruct<T>(this TextPrompt prompt) where T : class

Parameters

prompt TextPrompt

Returns

GENStructTask<T>

Type Parameters

T

GENStruct<T>(string, string)

public static GENStructTask<T> GENStruct<T>(this string prompt, string formattedPrompt = null) where T : class

Parameters

prompt string
formattedPrompt string

Returns

GENStructTask<T>

Type Parameters

T

GENTranscript(AudioClip)

Creates a speech-to-text (STT) task that transcribes spoken words from this audio clip.

Example: audioClip.GENTranscript().ExecuteAsync();

public static GENTranscriptTask GENTranscript(this AudioClip prompt)

Parameters

prompt AudioClip

Returns

GENTranscriptTask

GENTranslation(AudioClip)

Translates the speech in this audio clip into English text. Useful for multilingual voice input.

Example: audioClip.GENTranslation().ExecuteAsync();

public static GENTranslationTask GENTranslation(this AudioClip prompt)

Parameters

prompt AudioClip

Returns

GENTranslationTask

GENVideo(string, string)

Generates a video based on this prompt text.

Example: "A cat surfing a wave".GENVideoGen().ExecuteAsync();

public static GENVideoTask GENVideo(this string prompt, string formattedPrompt = null)

Parameters

prompt string
formattedPrompt string

Returns

GENVideoTask

GENVideo(Texture2D)

Generates a video based on this prompt image.

Example: texture.GENVideoGen().ExecuteAsync();

public static GENVideoTask GENVideo(this Texture2D prompt)

Parameters

prompt Texture2D

Returns

GENVideoTask

GENVoiceChange(AudioClip)

Changes the voice in this audio clip using AI voice transformation.

Example: audioClip.GENVoiceChange().SetVoice(ElevenLabsVoice.Rachel).ExecuteAsync();

public static GENVoiceChangeTask GENVoiceChange(this AudioClip prompt)

Parameters

prompt AudioClip

Returns

GENVoiceChangeTask