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.
| Property | Type | Description |
|---|---|---|
SessionId | string | Unique session identifier |
ConversationId | string | Persistent conversation ID (same player+character pair always resumes) |
CharacterId | string | The connected character's ID |
PlayerId | string | The 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.
| Property | Type | Description |
|---|---|---|
Text | string | Text content of this chunk |
IsFinal | bool | true when the response is complete |
IsPartial | bool | true for streaming chunks (!IsFinal) |
MessageId | string | Unique ID for this response message |
ChunkIndex | int | Sequential index of this chunk (0-based) |
IsInterjection | bool | true 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.
| Property | Type | Description |
|---|---|---|
Audio | string | Base64-encoded PCM16 audio data |
SampleRate | int | Audio sample rate in Hz |
ChunkIndex | int | Sequential index of this chunk |
MessageId | string | Message ID this audio belongs to |
IsLiveKit | bool | true if audio is routed through LiveKit |
Timestamp | double | Server timestamp |
DecodedAudio | byte[] | Decoded PCM16 bytes (populated after Audio is decoded) |
SttResponse
Speech-to-text transcription result.
| Property | Type | Description |
|---|---|---|
Text | string | Transcribed text |
IsFinal | bool | true 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 / Method | Type | Description |
|---|---|---|
Name | string | Action name (from the name attribute) |
Parameters | IReadOnlyDictionary<string, string> | All parameters as key-value pairs |
HasParameter(string name) | bool | Check if a parameter exists |
GetParameter(string name, string defaultValue = "") | string | Get a string parameter |
GetParameterInt(string name, int defaultValue = 0) | int | Get an integer parameter (parsed from string) |
GetParameterFloat(string name, float defaultValue = 0f) | float | Get a float parameter |
GetParameterBool(string name, bool defaultValue = false) | bool | Get 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.
| Property | Type | Description |
|---|---|---|
MessageId | string | The message that was interrupted |
InterruptedAt | double | Server timestamp of the interrupt |
QuotaExceededData
Sent when the API key's usage quota is exceeded.
| Property | Type | Description |
|---|---|---|
Error | string | Error type identifier |
Message | string | Human-readable error message |
Current | int | Current usage count |
Limit | int | Maximum allowed usage |
Remaining | int | Remaining quota |
Tier | string | API key tier (e.g., "free", "pro") |
SceneGraph
World-model scene graph built from video frames.
| Property | Type | Description |
|---|---|---|
Entities | List<SceneEntity> | Detected objects and people |
Relationships | List<SceneRelationship> | Spatial relationships between entities |
Surfaces | List<SceneSurface> | Detected surfaces (floors, walls, tables) |
Summary | string | Natural language scene summary |
LocationType | string | Detected location type (e.g., "office", "kitchen") |
UserActivity | string | Detected user activity (e.g., "sitting", "cooking") |
EntityCount | int | Total number of entities |
SceneEntity
| Property | Type | Description |
|---|---|---|
Id | string | Unique entity identifier |
ClassName | string | Object class (e.g., "person", "cup", "laptop") |
Label | string | Descriptive label |
Confidence | float | Detection confidence (0--1) |
Position | Vector3 | Estimated 3D position |
BoundingBox | Rect | 2D bounding box in image coordinates |
SceneRelationship
| Property | Type | Description |
|---|---|---|
SubjectId | string | Source entity ID |
ObjectId | string | Target entity ID |
Relationship | string | Relationship type (e.g., "on", "next_to", "holding") |
SceneSurface
| Property | Type | Description |
|---|---|---|
Id | string | Unique surface identifier |
Type | string | Surface type (e.g., "floor", "table", "wall") |
Normal | Vector3 | Surface normal vector |
SceneGraphUpdate
Wrapper for scene graph update events.
| Property | Type | Description |
|---|---|---|
SceneGraph | SceneGraph | The updated scene graph |
Timestamp | double | Server timestamp |
RoomIdentified
Room identification result from the world model.
| Property | Type | Description |
|---|---|---|
RoomName | string | Identified room name |
Status | string | Identification 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)
}