Class 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.
Implements
Inherited Members
Namespace: Glitch9.AIDevKit.Agents
Assembly: Glitch9.AIDevKit.dll
Syntax
public sealed class AgentDependencies : IDisposable
Properties
| Edit this page View SourceChat
[Optional] Custom chat API implementation to use for generating responses.
When null, the agent automatically selects the appropriate implementation
based on ChatApiType and the active model's API
(e.g. Chat Completions, Assistants, Realtime).
Declaration
public IStreamingChatService Chat { get; set; }
Property Value
| Type | Description |
|---|---|
| IStreamingChatService |
ConversationStore
[Optional] Conversation store implementation used to persist conversations.
When null, conversations are not persisted and the agent runs without conversation history.
Use AgentUtility.CreateConversationStore to create a store from a ConversationStoreType.
Declaration
public IConversationStore ConversationStore { get; set; }
Property Value
| Type | Description |
|---|---|
| IConversationStore |
EventListener
[Optional] Listener that receives agent lifecycle and response events.
When null, events are still dispatched internally but no external
callback is invoked. Implement this interface (e.g. on a MonoBehaviour) to
react to agent responses, errors, and status changes.
Declaration
public IAgentEventListener EventListener { get; set; }
Property Value
| Type | Description |
|---|---|
| IAgentEventListener |
ImageGeneration
[Optional] Custom image generation service.
Only used when HasOutputImage is true.
Falls back to DefaultImageGenerationApi when null.
Declaration
public IImageGeneration ImageGeneration { get; set; }
Property Value
| Type | Description |
|---|---|
| IImageGeneration |
InputAudioRecorder
[Optional] Recorder used to capture microphone input before transcription.
Only relevant when HasInputAudio is true.
When null, audio recording is disabled and the agent expects text input only.
Declaration
public ISpeechToTextRecorder InputAudioRecorder { get; set; }
Property Value
| Type | Description |
|---|---|
| ISpeechToTextRecorder |
InstructionsUpdater
[Optional] Dynamic instructions provider that updates system instructions before each request based on conversation history or external context.
When null, instructions remain static as set at construction time.
Declaration
public IInstructionsUpdater InstructionsUpdater { get; set; }
Property Value
| Type | Description |
|---|---|
| IInstructionsUpdater |
McpAccessToken
[Optional] Token service used for MCP (Model Context Protocol) OAuth flows.
Falls back to a new McpAccessTokenService instance when null.
Supply a custom instance to share token state across multiple agents.
Declaration
public McpAccessTokenService McpAccessToken { get; set; }
Property Value
| Type | Description |
|---|---|
| McpAccessTokenService |
OutputAudioPlayer
[Optional] Player used to play back synthesised speech output.
Only relevant when HasOutputAudio is true.
When null, audio playback is disabled and responses are text-only.
Declaration
public ITextToSpeechPlayer OutputAudioPlayer { get; set; }
Property Value
| Type | Description |
|---|---|
| ITextToSpeechPlayer |
SpeechToText
[Optional] Custom speech-to-text (transcription) service.
Only used when HasInputAudio is true.
Falls back to DefaultTranscriptionApi (HTTP) or a WebSocket implementation
depending on the STT endpoint protocol configured in InputAudioSettings.
Declaration
public ISpeechToText SpeechToText { get; set; }
Property Value
| Type | Description |
|---|---|
| ISpeechToText |
TextToSpeech
[Optional] Custom text-to-speech (speech generation) service.
Only used when HasOutputAudio is true.
Falls back to DefaultSpeechGenerationApi when null.
Declaration
public ITextToSpeech TextToSpeech { get; set; }
Property Value
| Type | Description |
|---|---|
| ITextToSpeech |
ToolCallHandler
[Optional] Custom handler that intercepts and processes tool calls before the built-in tool execution pipeline runs.
When null, the agent uses its default ToolController logic.
Useful for adding logging, validation, or routing to external executors.
Declaration
public IToolCallHandler ToolCallHandler { get; set; }
Property Value
| Type | Description |
|---|---|
| IToolCallHandler |
ToolRouter
[Optional] Tool router that selects which tools are forwarded to the LLM for each request.
When null, all registered tools are forwarded without filtering.
Declaration
public IToolRouter ToolRouter { get; set; }
Property Value
| Type | Description |
|---|---|
| IToolRouter |
Methods
| Edit this page View SourceDispose()
Declaration
public void Dispose()
InitAsync(Agent, CancellationToken)
Declaration
public UniTask InitAsync(Agent agent, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Agent | agent | |
| CancellationToken | ct |
Returns
| Type | Description |
|---|---|
| UniTask |