AI Dev Kit
Search Results for

    Show / Hide Table of Contents

    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
    Namespace: Glitch9.AIDevKit
    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
    Type Description
    GENAudioIsolationTask

    GENAudioIsolation(AudioSource)

    Declaration
    public static GENAudioIsolationTask GENAudioIsolation(this AudioSource target)
    Parameters
    Type Name Description
    AudioSource target
    Returns
    Type Description
    GENAudioIsolationTask

    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
    Type Name Description
    ChatSession chatSession
    ChatMessage chatMessage
    Returns
    Type Description
    GENChatTask

    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
    Type Description
    GENImageTask

    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
    Type Description
    GENImageTask

    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
    Type Description
    GENImageTask

    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
    Type Description
    GENImageTask

    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
    Type Name Description
    InpaintPrompt prompt
    Returns
    Type Description
    GENInpaintTask

    GENImageEdit(Image, string)

    Declaration
    public static GENInpaintTask GENImageEdit(this Image target, string inpaintInstruction)
    Parameters
    Type Name Description
    Image target
    string inpaintInstruction
    Returns
    Type Description
    GENInpaintTask

    GENImageEdit(RawImage, string)

    Declaration
    public static GENInpaintTask GENImageEdit(this RawImage target, string inpaintInstruction)
    Parameters
    Type Name Description
    RawImage target
    string inpaintInstruction
    Returns
    Type Description
    GENInpaintTask

    GENImageEdit(SpriteRenderer, string)

    Declaration
    public static GENInpaintTask GENImageEdit(this SpriteRenderer target, string inpaintInstruction)
    Parameters
    Type Name Description
    SpriteRenderer target
    string inpaintInstruction
    Returns
    Type Description
    GENInpaintTask

    GENImageVariation(Image)

    Declaration
    public static GENImageVariationTask GENImageVariation(this Image target)
    Parameters
    Type Name Description
    Image target
    Returns
    Type Description
    GENImageVariationTask

    GENImageVariation(RawImage)

    Declaration
    public static GENImageVariationTask GENImageVariation(this RawImage target)
    Parameters
    Type Name Description
    RawImage target
    Returns
    Type Description
    GENImageVariationTask

    GENImageVariation(SpriteRenderer)

    Declaration
    public static GENImageVariationTask GENImageVariation(this SpriteRenderer target)
    Parameters
    Type Name Description
    SpriteRenderer target
    Returns
    Type Description
    GENImageVariationTask

    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
    Type Description
    GENImageVariationTask

    GENInpaint(Texture2D, string)

    Declaration
    public static GENInpaintTask GENInpaint(this Texture2D promptImage, string inpaintInstruction)
    Parameters
    Type Name Description
    Texture2D promptImage
    string inpaintInstruction
    Returns
    Type Description
    GENInpaintTask

    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
    Type Description
    GENModerationTask

    A GENModerationTask that can be configured and executed.

    GENObject<T>(string)

    Declaration
    public static GENObjectTask<T> GENObject<T>(this string promptText)
    Parameters
    Type Name Description
    string promptText
    Returns
    Type Description
    GENObjectTask<T>
    Type Parameters
    Name Description
    T

    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
    Type Description
    GENSoundEffectTask

    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
    Type Description
    GENSoundEffectTask

    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
    Type Description
    GENSpeechTask

    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
    Type Description
    GENSpeechTask

    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
    Type Description
    GENTextTask

    A configurable GENContentTask instance.

    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
    Type Description
    GENTextTask

    A configurable GENContentTask instance.

    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
    Type Description
    GENTextTask

    A configurable GENContentTask instance.

    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
    Type Description
    GENTranscriptTask

    GENTranscript(Text, AudioClip)

    Declaration
    public static GENTranscriptTask GENTranscript(this Text target, AudioClip promptAudio)
    Parameters
    Type Name Description
    Text target
    AudioClip promptAudio
    Returns
    Type Description
    GENTranscriptTask

    GENTranscript(TextMesh, AudioClip)

    Declaration
    public static GENTranscriptTask GENTranscript(this TextMesh target, AudioClip promptAudio)
    Parameters
    Type Name Description
    TextMesh target
    AudioClip promptAudio
    Returns
    Type Description
    GENTranscriptTask

    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
    Type Description
    GENTranslationTask

    GENTranslation(Text, AudioClip)

    Declaration
    public static GENTranslationTask GENTranslation(this Text target, AudioClip promptAudio)
    Parameters
    Type Name Description
    Text target
    AudioClip promptAudio
    Returns
    Type Description
    GENTranslationTask

    GENTranslation(TextMesh, AudioClip)

    Declaration
    public static GENTranslationTask GENTranslation(this TextMesh target, AudioClip promptAudio)
    Parameters
    Type Name Description
    TextMesh target
    AudioClip promptAudio
    Returns
    Type Description
    GENTranslationTask

    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
    Type Description
    GENVideoTask

    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
    Type Description
    GENVideoTask

    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
    Type Description
    GENVoiceChangeTask

    GENVoiceChange(AudioSource)

    Declaration
    public static GENVoiceChangeTask GENVoiceChange(this AudioSource target)
    Parameters
    Type Name Description
    AudioSource target
    Returns
    Type Description
    GENVoiceChangeTask
    In this article
    Back to top Generated by DocFX