Skip to content

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

  1. Overall Flow: understand how the device, application server, and Tange platform interact.
  2. AI Talk Console: create roles, configure knowledge bases and plugins, and obtain role_id.
  3. Connect a Coze Agent: configure a Coze agent as a Tange role and use TiRTC for real-time voice conversations.
  4. Server Integration: request peer_id and token, then securely deliver them to the device.
  5. Device Integration: connect, start a session, exchange audio, add video talkback, and handle events.
  6. Event Protocol: implement start_session, captions, interruption, device capability calls, and session cleanup.

Roles

RoleResponsibility
Application serverGets role_id, requests peer_id and token, and securely sends them to the device.
DeviceUses peer_id and token to connect, starts the session, sends audio and video, and handles response audio and events.
Tange platformVerifies 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, and SecretKeyId for 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.

AI Chat