Passive Callback & Response API
Passive Callback & Response API
Callback / Response mapping
| Callback | Response | onRequest signature |
|---|---|---|
Audio2LlmCallback | Audio2LlmResponse | (agentId, eventId, flag, buf, param, response) |
Audio2TtsCallback | Audio2TtsResponse | (agentId, eventId, itemId, flag, buf, param, response) |
Asr2LlmCallback | Asr2LlmResponse | (agentId, eventId, text, param, response) |
Asr2TtsCallback | Asr2TtsResponse | (agentId, eventId, text, param, response) |
AsrVideo2VlmCallback | AsrVideo2VlmResponse | (agentId, eventId, flag, text, video, param, response) |
AsrVideo2TtsCallback | AsrVideo2TtsResponse | (agentId, eventId, flag, text, video, param, response) |
AudioVideo2VlmCallback | AudioVideo2VlmResponse | (agentId, eventId, flag, data, param, response) |
AudioVideo2TtsCallback | AudioVideo2TtsResponse | (agentId, eventId, flag, data, param, response) |
Response capability matrix
| Response | ASR | LLM | VLM | TTS | Skill | Interrupt |
|---|---|---|---|---|---|---|
| Audio2LlmResponse | ✓ | ✓ | ✓ | ✓ | ||
| Audio2TtsResponse | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Asr2LlmResponse | ✓ | ✓ | ✓ | |||
| Asr2TtsResponse | ✓ | ✓ | ✓ | ✓ | ||
| AsrVideo2VlmResponse | ✓ | ✓ | ✓ | |||
| AsrVideo2TtsResponse | ✓ | ✓ | ✓ | ✓ | ||
| AudioVideo2VlmResponse | ✓ | ✓ | ✓ | ✓ | ||
| AudioVideo2TtsResponse | ✓ | ✓ | ✓ | ✓ | ✓ |
Every response supports onError(eventId, errorCode, errorMsg).
Shared base methods (PassiveCallback)
Every callback class extends PassiveCallback. The following methods may be overridden as needed
(they have safe no-op log defaults):
| Method | Trigger |
|---|---|
onRobotOnline(agentId, agentMeta) | Robot online |
onRobotOffline(agentId) | Robot offline |
onFaceInfo(agentId, eventId, param) | Face / voiceprint UID detected (opened in v1.4.0) |
onVideoFrame(agentId, eventId, flag, buf, isKeyFrame, localTs, param) | Video passthrough (flag=2 H264, flag=3 image) |
onGreetSignal(agentId, eventId, param, GreetResponse response) | Greeting signal (merged in v1.4.0) |
onState(agentId, eventId, stateName, stateValue) | Robot state push (merged in v1.4.0); see robot-side state modules for the full catalogue |
GreetResponse methods
| Method | Description |
|---|---|
onGreetVlmDelta(eventId, text) | VLM streaming chunk |
onGreetVlmDone(eventId) | VLM streaming finished |
onGreetTtsDelta(eventId, audioBase64) | TTS audio chunk — audioBase64 is the base64-encoded chunk of synthesised audio bytes |
onGreetTtsDone(eventId) | TTS audio stream finished |
onError(eventId, code, msg) | Error reply |