AI Chat Docs
AI Chat provides real-time AI interaction for IoT devices through TiRTC. A device connects to the Tange platform, sends microphone audio and optional camera video, and receives generated voice, captions, and control events over the same low-latency connection.
What You Can Build
- Add real-time voice conversation to AI toys, companion devices, speakers, cameras, doorbells, robots, and other IoT devices.
- Collaborate with the platform through command-channel messages during a conversation.
- Use one TiRTC connection for audio uplink, audio downlink, captions, interruptions, device capability calls, and session lifecycle events.
Start Here
- Overall Flow: understand how the device, application server, and Tange platform interact.
- AI Talk Console: create roles, configure knowledge bases and plugins, and obtain
role_id. - Connect a Coze Agent: configure a Coze agent as a Tange role and use TiRTC for real-time voice conversations.
- Server Integration: request
peer_idandtoken, then securely deliver them to the device. - Device Integration: connect, start a session, exchange audio, add video talkback, and handle events.
- Event Protocol: implement
start_session, captions, interruption, device capability calls, and session cleanup.
Roles
| Role | Responsibility |
|---|---|
| Application server | Gets role_id, requests peer_id and token, and securely sends them to the device. |
| Device | Uses peer_id and token to connect, starts the session, sends audio and video, and handles response audio and events. |
| Tange platform | Verifies credentials, loads device and role configuration, and handles ASR, visual understanding, LLM, TTS, and event delivery. |
Prerequisites
- You have created a Tange platform application and obtained
AppId,AccessKeyId, andSecretKeyIdfor server-side API calls. - You have registered devices and bound them to your application or product.
- You have enabled the AI Chat service capability.
- You have created and configured an AI agent on the Tange open platform.
- Your device has integrated the TiRTC SDK and can establish connections, send audio frames, and exchange commands. Video talkback also requires H.264 or H.265 encoded frames.