Namespace Glitch9.AIDevKit.Agents
Classes
AdaptiveInstructionsSettings
AdaptiveInstructionsUpdater
Embedding-based dynamic instructions updater.
Register multiple InstructionsRule entries; before each request the updater embeds the user message, computes cosine similarity against every rule description, and returns the instructions of the best-matching rule.
Returns null (leaving instructions unchanged) when no rule exceeds MinSimilarity.
var updater = new AdaptiveInstructionsUpdater(embeddingModel)
.AddRule("user is asking about billing or payments", billingInstructions)
.AddRule("user is reporting a bug or technical issue", techSupportInstructions)
.SetMinSimilarity(0.72f);
agent.SetInstructionsUpdater(updater);
Agent
AI Agent that can generate responses using various models and manage conversations.
- Wraps model, tools, audio, and conversation management in a single fa�?��de.
- Uses internal services for conversations, tool calls, and audio I/O.
- Acts as the main entry point for runtime chat / tool workflows.
AgentAssistantsSettings
Configuration settings for the OpenAI Assistants API.
AgentBehaviour
Agent behaviour callbacks and UnityEvent bridges.
- Implements listener interfaces for agent, conversation, text, image, and tool events.
- Exposes UnityEvents so game code and UI can react to agent activity.
- Converts low-level deltas and tool outputs into high-level Unity events.
AgentDependencies
Optional external dependency overrides injected into an Agent at construction time.
All properties are optional; each falls back to a sensible default when left null.
Supply only the dependencies you need to customise; leave the rest unset.
AgentProfile
Comprehensive configuration settings for an AI agent including models, parameters, tools, and behavior.
AgentRealtimeOptions
Runtime composition of realtime chat options from agent-level settings.
AgentSaveData
AgentSaveData.AIResourceTracker
AgentSaveData.ChatSaveData
AgentSaveData.ConversationSaveData
AgentSaveData.PersonalizationItem
AgentSaveData.PersonalizationSaveData
AgentSaveData.VoiceInputSaveData
AgentSaveData.VoiceOuputSaveData
AgentSession
AgentSessionSettingsBase
AgentStatusChangedEvent
AgentToolRoutingSettings
AssistantPersona
Persona profile with optional personality traits that augment behavior instructions.
AssistantsApiChatService
AssistantsApiVisitor
CharacterPersona
ChatSessionSettings
CodeInterpreterToolDefinition
ComputerUseCallManager
Manages and executes computer actions that can be called by AI agents.
ComputerUseToolDefinition
ConversationController
CustomToolCallManager
CustomToolDescriptor
Describes a MonoBehaviour method mapped to an AI-callable custom tool.
DefaultAgentSettings
DefaultAgentSettingsUtility
DefaultInstructionsUpdater
LLM-driven dynamic instructions updater with embedding-based topic shift detection.
No rules need to be defined manually. The updater uses embeddings to detect topic shifts and only calls the LLM to regenerate system instructions when a shift is detected.
How it works:
- Every turn: embed the user message (cheap)
- Compare cosine similarity against the cached embedding
- If similarity < TopicShiftThreshold, regenerate instructions via LLM (expensive)
- Otherwise reuse the cached instructions (returns null)
var updater = new DefaultInstructionsUpdater(embeddingModel, generationModel)
.SetMetaInstructions("This agent helps customers with our SaaS product.")
.SetTopicShiftThreshold(0.80f)
.SetMaxTokens(300);
agent.SetInstructionsUpdater(updater);
DefaultOutputAudioPlayer
DefaultToolCallHandler
DefaultToolRouter
Embedding-based tool router.
Flow: ToolRegistry (full tool list) ??embed each tool's description text ??ToolEmbeddingIndex (in-memory) ??embed user message ??cosine similarity search ??pass only top-K tools to the LLM (reduces prompt token count)
If total tool count is ??topK, the full list is returned without filtering. Falls back to the full list if embedding fails.
FileSearchToolDefinition
FunctionCallManager
Manages and executes registered functions that can be called by AI agents.
- Caches MethodInfo and Delegate for performance
- JSON binding for arguments and return values
- Supports CancellationToken
- Supports void/UniTask/UniTaskT return types
FunctionDescriptor
Describes a C# method registered as an AI-callable function.
GenerativeControllerBase<TDelta, TOutput, TService, TSettings>
Base class for generative controllers (TTS, STT, Image) that support both REST and Streaming modes. Provides common infrastructure for service management and error handling.
ImageGenerationController
InstructionsRule
A single rule registered in AdaptiveInstructionsUpdater.
InstructionsUpdaterBase<TSettings>
McpServerSettings
Container that groups multiple MCP tool definitions (McpToolDefinition) into one. MCP hosted tool settings used by AgentProfile.
MediaController
Manages all media generation capabilities including speech-to-text, text-to-speech, and image generation. Consolidates audio and visual output generation for the Agent.
MemoryPersonalizationSettings
MemoryProfile
Conversation and memory configuration profile used by agents.
MemoryRagSettings
MemorySettings
MemorySummarySettings
MemoryTitleSettings
ModelChangedEvent
ModerationSessionSettings
NpcPersona
PersonaBase
PersonaInstruct
RealtimeApiChatService
ReasoningEffortChangedEvent
ShellCommandCallManager
Manages and executes local shell commands that can be called by AI agents.
SpeechSessionSettings
SpeechToTextController
StreamingTextThrottler
Unity MonoBehaviour managing multiple StreamingTextThrottler instances by TextType. Coordinates throttled text streaming for different content types (messages, thoughts, code blocks) with configurable chunk rate and tick interval.
StreamingTextThrottler.TextTickEvent
Unity event invoked when a text chunk is emitted during streaming.
TextEditorToolDefinition
TextToSpeechController
ToolCallConfig
Configuration settings that control how an AI agent handles function/tool calls during interactions.
ToolCallManagerBase<TCall, TOutput>
ToolController
ToolDescriptorBase
Shared base class for descriptors that map AI tool/function calls to MonoBehaviour methods. Holds serialized metadata and the runtime execution cache.
ToolRegistry
TranscriptionSessionSettings
VoiceChangedEvent
WebSearchToolDefinition
XSearchToolDefinition
Structs
CharacterPresetData
ToolOutputResult
Interfaces
IAdaptiveInstructionsUpdaterSettings
IAgentBehaviour
Defines the behavior and configuration settings for an AI agent, including conversation management, tool calling policies, streaming options, and logging preferences.
IAgentDependency
Interface for components that depend on an agent and require initialization and cleanup.
IAgentEventHandler
Unified interface for handling all agent-related events across different API types (ChatCompletions, Responses, Realtime) and conversation/status events.
IAgentEventListener
Listener interface for handling all agent-related events including streaming responses, conversation changes, and agent status updates.
IAgentSettings
A thin interface representing the core settings required to configure an Agent instance. Allows providing custom settings without a AgentSettings ScriptableObject.
IComputerUseActionHandler
Handler interface for executing computer use actions dispatched by AI agents. Keys are passed as strings from the implementation (e.g., "Ctrl+Shift+P", "Enter", "Meta").
IComputerUseExecutor
IComputerUseSafetyCheckService
Service interface for approving or rejecting pending computer use safety checks.
ICustomToolExecutor
IDefaultInstructionsUpdaterSettings
IFunctionExecutor
IInstructionsUpdater
Dynamically updates system instructions before each request is sent to the LLM. Implement this interface to adapt the agent's behaviour based on conversation history or any external context (user state, scene data, game phase, etc.).
IInstructionsUpdaterSettings
ILocalShellExecutor
IMemoryPersonalizationSettings
IMemoryRagSettings
IMemorySettings
IMemorySummarySettings
IMemoryTitleSettings
ISpeechToTextRecorder
Interface for recording audio input and converting it to text via speech recognition.
ITextToSpeechPlayer
Interface for playing synthesized speech audio from text-to-speech output.
IToolCallExecutor<TCall, TOutput>
IToolCallHandler
IToolProvider
IToolRouter
Selects which tools to forward to the LLM for a given user message. Implement this interface to provide a custom routing strategy (e.g. rule-based, tag-based, or embedding-based).
Enums
AgentCapabilities
AgentStatus
High-level lifecycle state of an Agent.
AgentTraits
CharacterDisposition
CharacterKnowledgeScope
CharacterRole
CharacterSpeechStyle
ChatApi
Defines the type of AI agent, which determines which API it uses.
- DefaultUses Responses API if supported, or ChatCompletions API.
- AssistantsApiUses Assistants API (OpenAI).
- RealtimeApiUses Realtime API (OpenAI/WebSocket)
ConversationSelectMode
Specifies how the conversation ID should be determined when initializing an agent.
FamousCharacterPreset
MemoryCapabilities
ScreenshotPathType
UnhandledToolCallBehaviour
Defines the policy to apply when a tool call is received but the agent has no handler for it.