AI Dev Kit
API ReferencesDiscordGlitch9
  • Introduction
    • AI DevKit 3.7.0
    • Troubleshooting
    • FAQ
    • Update Logs
  • Provider Setup
    • OpenAI
    • Google Gemini
    • ElevenLabs
    • Ollama
    • OpenRouter
  • Editor Tools
    • Introduction
    • Editor Chat
    • Model Library
    • Voice Library
  • GEN Tasks
    • Introduction - Prefixes
    • Text/Content Generation
      • Structured Outputs (JSON Mode)
    • Chat Session
    • Image Generation
    • Video Generation
    • Sound FX Generation
    • Text to Speech (TTS)
    • Speech to Text (STT)
    • Voice Change
    • Audio Isolation
  • Advanced APIs (Pro)
    • Assistants API
      • How it works
      • Creating custom functions
      • Creating assistants API
    • Realtime API
  • Legacy API
    • OpenAI
      • 💬Chat completions
      • 🖼️Image operations
      • 🗣️Text to speech
      • 🎙️Speech to text
        • Recording real-time in Unity
      • 💾Files
      • 🔎Embeddings
      • 🛡️Moderations
      • ⚙️Fine-tuning
    • Google Gemini
      • 📝System instructions
      • 💬Text generation
      • ⚙️Fine-tuning
      • ▶️Fucntion calling
      • 🔎Embeddings
      • 🛡️Safety
      • 💻Code execution
  • Legacy Documents
    • AI DevKit 1.0 - 2.0
      • AI DevKit 2.0
      • AI DevKit 1.0
      • Preperation
      • Event Handlers
      • Scriptable Toolkits
        • Chat Streamer
        • Image Generator
        • Voice Transcriber
        • Voice Generator
      • Editor Tools
      • Troubleshooting (Legacy)
        • ❗Build Error: The name 'UnityMenu' does not exist in the current context
        • ❗The type or namespace name 'AndroidJavaObject' could not be found
        • ❗The type or namaspace name 'Plastic' does not exist
        • ❗Build Error: The name 'Asset Database' does not exist in the current context
        • ❗'ModelData.Create(Provider, string, UnixTime?, string)': not all code paths return a value
      • Code Generators
        • C# Script Generator
        • Unity Component Generator
      • Generation Menu
      • Editor Chat
      • Editor Vision (TTI, ITI)
      • Editor Speech (TTS)
      • Management Tools
        • Prompt History Viewer
        • AI Model Manager
        • TTS Voice Manager
        • OpenAI File Manager
        • OpenAI Assistant Manager
        • ElevenLabs Voice Library
Powered by GitBook
On this page
  1. GEN Tasks

Introduction - Prefixes

To get the most out of IntelliSense when using the AI Dev Kit, the following prefixes are designed to make autocomplete clean, fast, and intuitive. Try to remember and follow these naming conventions:


GEN — Prefix for All Task Creators

These are extension methods that can be called directly on known objects to start an AI generation task.

1. Prompt-based Pattern Called from prompt-like data types:

Prompt Type
Usage

string

Text/Content Generation Image Generation Speech Generation (TTS) Sound FX Generation Video Generation

AudioClip

Transcript Generation (STT) Voice Change Audio Isolation

Texture2D, Sprite

Text/Content Generation (Vision) Image Edit (Inpaint) Image Variation

ChatSession

Chat

string aiJoke = await "Tell me a joke."
    .GENText()
    .SetModel(OpenAIModel.GPT4o)
    .ExecuteAsync();

string transcript = await audioClip
    .GENTranscript()
    .ExecuteAsync();
    
Texture2D aiImage = await "A cyberpunk city at night"
    .GENImage()
    .ExecuteAsync();

2. UnityEngine.Object-based Pattern Called from Unity UI or scene objects — automatically applies the result to the target:

Type
UnityEngine.Object
Usage

Text

UnityEngine.UI.Text UnityEngine.TextMesh TMPro.TMP_Text TMPro.TextMeshProUGUI TMPro.TextMeshPro

Text Generation Transcript Generation (STT)

Image / Texture

UnityEngine.UI.Image UnityEngine.UI.RawImage UnityEngine.SpriteRenderer

Image Generation Image Edit (Inpaint) Image Variation

Audio

UnityEngine.AudioSource

Speech Generation (TTS) Sound FX Generation Voice Change Audio Isolation

myTMPText.GENText("What’s the weather?").ExecuteAsync();
myImage.GENImage("A sunset over the ocean").ExecuteAsync();
myAudioSource.GENSpeech("Welcome back!").ExecuteAsync();

Set — Prefix for All Configuration Options

Use this to configure task parameters such as model, output count, output path, and advanced options like reasoning, web search, or voice settings.

task
    .SetModel(OpenAIModel.GPT4o)
    .SetCount(3)
    .SetReasoningEffort(ReasoningEffort.High);

On — Prefix for All Streaming Callbacks

Use these methods to attach real-time callbacks for streamed results, such as receiving text tokens, tool calls, or error handling.

task
    .OnStreamText(Debug.Log)
    .OnStreamError(HandleError)
    .OnStreamDone(OnGenerationComplete);

Append — Prefix for Task Sequences

new GENSequence()
    .Append("Generate story".GENText())
    .AppendInterval(2.0f)
    .Append("Generate image".GENImage())
    .ExecuteAsync();

These prefixes follow a consistent pattern to maximize IntelliSense usability and make task flows easy to read and construct.

Tip: Just type GEN, Set, or On and let IntelliSense show you what’s possible.

PreviousVoice LibraryNextText/Content Generation

Last updated 13 hours ago

Used with to compose a sequence of tasks or insert delays between steps.

GENSequence