Agent Properties

Complete reference for Agent class properties.

Overview

The Agent class provides core runtime properties for AI conversation management. Properties are organized by category: configuration, state, conversation, parameters, and capabilities.

Model & Provider Properties

Model

public Model Model { get; set; }

Active language model for text generation.

Example:

agent.Model = Model.GPT4;
agent.Model = Model.Claude35Sonnet;
agent.Model = Model.Gemini15Pro;

SpeechModel

public Model SpeechModel { get; set; }

Model used for text-to-speech synthesis.

Example:

agent.SpeechModel = Model.TTS1HD;

TranscriptionModel

public Model TranscriptionModel { get; set; }

Model used for audio transcription.

Example:

agent.TranscriptionModel = Model.Whisper1;

ImageModel

public Model ImageModel { get; set; }

Model used for image generation.

Example:

agent.ImageModel = Model.DallE3;

ChatServiceApi

public ChatService ChatServiceApi { get; }

Read-only. Current chat service API (Responses/Realtime).

Values:

  • ChatService.Default - Responses API

  • ChatService.ResponsesApi - Responses API

  • ChatService.RealtimeApi - Realtime API

Voice & Audio Properties

Voice

public Voice Voice { get; set; }

TTS voice for audio responses.

Example:

agent.Voice = Voice.Alloy;
agent.Voice = Voice.Nova;

OutputAudioVolume

public float OutputAudioVolume { get; set; }

Master volume for speech output (0.0 to 1.0).

Example:

agent.OutputAudioVolume = 0.8f;

InputAudioLanguage

public SystemLanguage InputAudioLanguage { get; set; }

Language for audio input and transcription.

Example:

agent.InputAudioLanguage = SystemLanguage.English;
agent.InputAudioLanguage = SystemLanguage.Korean;

Configuration Properties

Name

public string Name { get; set; }

Human-readable agent name.

Example:

agent.Name = "Assistant";
agent.Name = "GameMaster";

Id

public string Id { get; }

Read-only. Unique agent identifier.

ConversationId

public string ConversationId { get; set; }

Current conversation identifier.

Example:

agent.ConversationId = "conv_123";

Instructions

public string Instructions { get; }

Read-only. System-level instructions for the agent.

Settings

public AgentSettings Settings { get; }

Read-only. Agent configuration settings.

State Properties

Status

public AgentStatus Status { get; }

Read-only. Current agent lifecycle state.

Values:

  • None - Not initialized

  • Initializing - Initialization in progress

  • InitializationFailed - Failed to initialize

  • Ready - Ready for requests

  • Processing - Handling request

  • Terminating - Shutting down

Example:

if (agent.Status == AgentStatus.Ready)
{
    await agent.GenerateResponseAsync("Hello");
}

IsInitialized

public bool IsInitialized { get; }

Read-only. True when agent is fully initialized.

Example:

if (!agent.IsInitialized)
{
    await agent.InitializeAsync();
}

CurrentResponse

public Response CurrentResponse { get; }

Read-only. Response currently being generated.

Conversation Properties

Conversation

public Conversation Conversation { get; }

Read-only. Active conversation instance.

Example:

var messages = agent.Conversation.Messages;
var id = agent.Conversation.Id;

Items

public List<ConversationItem> Items { get; }

Read-only. All items in the conversation (messages, tool calls, outputs).

Example:

foreach (var item in agent.Items)
{
    Debug.Log($"{item.Type}: {item}");
}

Messages

public List<Message> Messages { get; }

Read-only. User and assistant messages only.

Example:

foreach (var message in agent.Messages)
{
    Debug.Log($"{message.Role}: {message.Content}");
}

LastMessage

public Message LastMessage { get; }

Read-only. Most recent message in conversation.

Example:

if (agent.LastMessage?.Role == ConversationRole.Assistant)
{
    Debug.Log($"Last response: {agent.LastMessage.Content}");
}

Parameter Properties

Tools

public List<Tool> Tools { get; }

Read-only. Registered tool definitions.

Example:

Debug.Log($"Registered tools: {agent.Tools.Count}");
foreach (var tool in agent.Tools)
{
    Debug.Log($"- {tool.Function.Name}");
}

ToolChoice

public ToolChoice ToolChoice { get; set; }

Tool selection strategy.

Values:

  • ToolChoice.Auto - Model decides

  • ToolChoice.None - No tools

  • ToolChoice.Required - Must use tool

  • ToolChoice.Function("name") - Specific tool

Example:

agent.ToolChoice = ToolChoice.Auto;
agent.ToolChoice = ToolChoice.Function("get_weather");

MaxTokens

public int? MaxTokens { get; }

Read-only. Maximum tokens for response.

Temperature

public float? Temperature { get; }

Read-only. Randomness/creativity level (0.0 to 2.0).

Capability Properties

HasInputAudio

public bool HasInputAudio { get; }

Read-only. True if agent accepts audio input.

Example:

if (agent.HasInputAudio)
{
    ShowMicrophoneButton();
}

HasOutputAudio

public bool HasOutputAudio { get; }

Read-only. True if agent can output speech.

Example:

if (agent.HasOutputAudio)
{
    ShowSpeakerButton();
}

HasOutputImage

public bool HasOutputImage { get; }

Read-only. True if agent can generate images.

Example:

if (agent.HasOutputImage)
{
    ShowImagePanel();
}

HasMcpTool

public bool HasMcpTool { get; set; }

True if agent has MCP tools registered.

Behavior Properties

ConversationStoreType

public ConversationStoreType ConversationStoreType { get; }

Read-only. Storage backend for conversations.

Values:

  • LocalFile - Local file system

  • CloudStorage - Cloud storage

  • Database - Database

Stream

public bool Stream { get; }

Read-only. True if streaming responses enabled.

LogLevel

public TraceLevel LogLevel { get; }

Read-only. Logging verbosity level.

Values:

  • Off - No logging

  • Error - Errors only

  • Warning - Warnings and errors

  • Info - Informational

  • Verbose - Detailed debug info

WaitForToolCallsCompletion

public bool WaitForToolCallsCompletion { get; }

Read-only. True if agent waits for all tool calls to complete.

UnhandledToolCallBehaviour

public UnhandledToolCallBehaviour UnhandledToolCallBehaviour { get; }

Read-only. Policy for unhandled tool calls.

Values:

  • Ignore - Skip unhandled calls

  • ThrowError - Throw exception

  • SubmitToolOutput - Wait for external submission

  • Event - Fire onUnhandledToolCall event

SubmitToolOutputTimeoutSeconds

public int SubmitToolOutputTimeoutSeconds { get; }

Read-only. Timeout for tool output submission (seconds).

Controller Properties

conversationController

public readonly ConversationController conversationController;

Read-only. Conversation management controller.

audioController

public readonly AudioController audioController;

Read-only. Audio I/O controller.

imageController

public readonly ImageController imageController;

Read-only. Image generation controller.

toolCallController

public readonly ToolCallController toolCallController;

Read-only. Tool execution controller.

mcpController

public readonly McpController mcpController;

Read-only. MCP integration controller.

Complete Example

using UnityEngine;
using Glitch9.AIDevKit.Agents;

public class AgentPropertiesDemo : MonoBehaviour
{
    [SerializeField] private AgentBehaviour agent;
    
    void Start()
    {
        DisplayAgentProperties();
    }
    
    void DisplayAgentProperties()
    {
        Debug.Log("=== Agent Properties ===");
        
        // Identity
        Debug.Log($"Id: {agent.Agent.Id}");
        Debug.Log($"Name: {agent.Agent.Name}");
        
        // State
        Debug.Log($"Status: {agent.Agent.Status}");
        Debug.Log($"IsInitialized: {agent.Agent.IsInitialized}");
        
        // Models
        Debug.Log($"Model: {agent.Agent.Model}");
        Debug.Log($"SpeechModel: {agent.Agent.SpeechModel}");
        Debug.Log($"TranscriptionModel: {agent.Agent.TranscriptionModel}");
        
        // Voice
        Debug.Log($"Voice: {agent.Agent.Voice}");
        Debug.Log($"Volume: {agent.Agent.OutputAudioVolume}");
        Debug.Log($"Language: {agent.Agent.InputAudioLanguage}");
        
        // Conversation
        Debug.Log($"ConversationId: {agent.Agent.ConversationId}");
        Debug.Log($"Messages: {agent.Agent.Messages?.Count ?? 0}");
        Debug.Log($"Tools: {agent.Agent.Tools?.Count ?? 0}");
        
        // Capabilities
        Debug.Log($"HasInputAudio: {agent.Agent.HasInputAudio}");
        Debug.Log($"HasOutputAudio: {agent.Agent.HasOutputAudio}");
        Debug.Log($"HasOutputImage: {agent.Agent.HasOutputImage}");
        
        // Parameters
        Debug.Log($"Temperature: {agent.Agent.Temperature}");
        Debug.Log($"MaxTokens: {agent.Agent.MaxTokens}");
        Debug.Log($"ToolChoice: {agent.Agent.ToolChoice}");
    }
}

Next Steps

Last updated