Skip to main content

Data Models

All data model classes live in the Estuary.Models namespace. Each class has a static FromJson(JObject) factory method that maps snake_case JSON fields to PascalCase C# properties.


SessionInfo

Returned by the server after a successful connection handshake.

PropertyTypeDescription
SessionIdstringUnique session identifier
ConversationIdstringPersistent conversation ID (same player+character pair always resumes)
CharacterIdstringThe connected character's ID
PlayerIdstringThe player's ID
character.OnConnected += (SessionInfo session) =>
{
Debug.Log($"Session: {session.SessionId}");
Debug.Log($"Conversation: {session.ConversationId}");
};

BotResponse

A single chunk of a streaming text response.

PropertyTypeDescription
TextstringText content of this chunk
IsFinalbooltrue when the response is complete
IsPartialbooltrue for streaming chunks (!IsFinal)
MessageIdstringUnique ID for this response message
ChunkIndexintSequential index of this chunk (0-based)
IsInterjectionbooltrue if this is a proactive (unprompted) message

When IsFinal is true, Text contains the complete response (not just the final chunk).


BotVoice

A single chunk of streaming TTS audio.

PropertyTypeDescription
AudiostringBase64-encoded PCM16 audio data
SampleRateintAudio sample rate in Hz
ChunkIndexintSequential index of this chunk
MessageIdstringMessage ID this audio belongs to
IsLiveKitbooltrue if audio is routed through LiveKit
TimestampdoubleServer timestamp
DecodedAudiobyte[]Decoded PCM16 bytes (populated after Audio is decoded)

SttResponse

Speech-to-text transcription result.

PropertyTypeDescription
TextstringTranscribed text
IsFinalbooltrue for final transcription, false for interim results

Interim results (IsFinal = false) update in real-time as the user speaks. Final results indicate Deepgram has committed the transcription.


AgentAction

A parsed action tag extracted from a bot response.

Property / MethodTypeDescription
NamestringAction name (from the name attribute)
ParametersIReadOnlyDictionary<string, string>All parameters as key-value pairs
HasParameter(string name)boolCheck if a parameter exists
GetParameter(string name, string defaultValue = "")stringGet a string parameter
GetParameterInt(string name, int defaultValue = 0)intGet an integer parameter (parsed from string)
GetParameterFloat(string name, float defaultValue = 0f)floatGet a float parameter
GetParameterBool(string name, bool defaultValue = false)boolGet a boolean parameter
character.OnActionReceived += (AgentAction action) =>
{
if (action.Name == "navigate")
{
string target = action.GetParameter("target");
float speed = action.GetParameterFloat("speed", 1.0f);
bool run = action.GetParameterBool("run", false);
}
};

InterruptData

Confirmation from the server that an interrupt was processed.

PropertyTypeDescription
MessageIdstringThe message that was interrupted
InterruptedAtdoubleServer timestamp of the interrupt

QuotaExceededData

Sent when the API key's usage quota is exceeded.

PropertyTypeDescription
ErrorstringError type identifier
MessagestringHuman-readable error message
CurrentintCurrent usage count
LimitintMaximum allowed usage
RemainingintRemaining quota
TierstringAPI key tier (e.g., "free", "pro")

SceneGraph

World-model scene graph built from video frames.

PropertyTypeDescription
EntitiesList<SceneEntity>Detected objects and people
RelationshipsList<SceneRelationship>Spatial relationships between entities
SurfacesList<SceneSurface>Detected surfaces (floors, walls, tables)
SummarystringNatural language scene summary
LocationTypestringDetected location type (e.g., "office", "kitchen")
UserActivitystringDetected user activity (e.g., "sitting", "cooking")
EntityCountintTotal number of entities

SceneEntity

PropertyTypeDescription
IdstringUnique entity identifier
ClassNamestringObject class (e.g., "person", "cup", "laptop")
LabelstringDescriptive label
ConfidencefloatDetection confidence (0--1)
PositionVector3Estimated 3D position
BoundingBoxRect2D bounding box in image coordinates

SceneRelationship

PropertyTypeDescription
SubjectIdstringSource entity ID
ObjectIdstringTarget entity ID
RelationshipstringRelationship type (e.g., "on", "next_to", "holding")

SceneSurface

PropertyTypeDescription
IdstringUnique surface identifier
TypestringSurface type (e.g., "floor", "table", "wall")
NormalVector3Surface normal vector

SceneGraphUpdate

Wrapper for scene graph update events.

PropertyTypeDescription
SceneGraphSceneGraphThe updated scene graph
TimestampdoubleServer timestamp

RoomIdentified

Room identification result from the world model.

PropertyTypeDescription
RoomNamestringIdentified room name
StatusstringIdentification status (e.g., "identified", "uncertain")

Enums

ConnectionState

public enum ConnectionState
{
Disconnected, // Not connected
Connecting, // Handshake in progress
Connected, // Active session
Reconnecting, // Attempting to reconnect after a drop
Error // Connection failed
}

LiveKitConnectionState

public enum LiveKitConnectionState
{
Disconnected, // Not connected to LiveKit
RequestingToken, // Waiting for JWT token from server
Connecting, // Connecting to LiveKit room
WaitingForBot, // In room, waiting for bot to join
Ready, // Bot has joined, audio is flowing
Error // LiveKit connection failed
}

VoiceMode

public enum VoiceMode
{
WebSocket, // Audio over Socket.IO (base64 PCM)
LiveKit // Audio over WebRTC (LiveKit)
}

WebcamStreamMode

public enum WebcamStreamMode
{
LiveKit, // Video over WebRTC (LiveKit video track)
WebSocket // Video over Socket.IO (base64 JPEG)
}