Chat Mode
Chat Mode provides standard text and voice chat functionality with pre-recorded avatar responses. Messages are sent via WebSocket and responses are delivered as text with optional audio/video URLs.
Overview
Workflow:
- Establish WebSocket connection (see WebSocket API)
- Send text or audio messages with
isLive: false - Receive text response with optional
fileUrlfor audio/video playback
tip:
For real-time interactive sessions with streaming 3D avatar responses, use Live Mode instead.
Sending Text Messages
Send a text message via WebSocket.
WebSocket Message:
{
"avatar_id": "avatar-id-123",
"user_id": "user-123",
"chat_type": "text",
"language": "en",
"request": "Hello, how are you?",
"requestType": "text",
"source": "my-source-app-name",
"isLive": false,
"session": "session-identifier"
}
| Field | Type | Required | Description |
|---|---|---|---|
avatar_id | string | Yes | Target avatar identifier |
user_id | string | Yes | User identifier |
chat_type | string | Yes | "text" |
language | string | Yes | Language code (e.g., "en") |
request | string | Yes | Message text content |
requestType | string | Yes | "text" |
source | string | Yes | Client identifier (e.g., "mobile-app") |
isLive | boolean | Yes | false for Chat Mode |
session | string | No | Session identifier from configuration |
Sending Audio Messages
Send an audio message via WebSocket.
WebSocket Message:
{
"avatar_id": "avatar-id-123",
"user_id": "user-123",
"chat_type": "voice",
"language": "en",
"requestType": "audio",
"source": "my-source-app-name",
"isLive": false,
"isPushToTalk": true,
"file_base64_data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
"session": "session-identifier"
}
| Field | Type | Required | Description |
|---|---|---|---|
avatar_id | string | Yes | Target avatar identifier |
user_id | string | Yes | User identifier |
chat_type | string | Yes | "voice" |
language | string | Yes | Language code |
requestType | string | Yes | "audio" |
source | string | Yes | Client identifier |
isLive | boolean | Yes | false for Chat Mode |
isPushToTalk | boolean | No | true when VAD is disabled (see Voice Activity Detection) |
file_base64_data | string | Yes | Base64-encoded audio blob |
session | string | No | Session identifier |
Standard Audio Format
For Chat Mode audio messages, use the following audio format:
| Property | Value |
|---|---|
| Format | WAV or WebM |
| Sample Rate | 16,000 Hz (16 kHz) |
| Channels | Mono (1 channel) |
| Encoding | Base64 |
| Transmission Field | file_base64_data |
Audio Recording Constraints:
{
"sampleRate": 16000,
"echoCancellation": true,
"noiseSuppression": true,
"autoGainControl": true,
"channelCount": 1
}
note:
For Live Mode audio using PCM format, see the Live Mode documentation. For a comparison of both audio formats, see Audio Format Comparison.