For the complete documentation index, see llms.txt. This page is also available as Markdown.

ConvaiClient(核心 API)

ConvaiClient 是在原生 TypeScript 中管理 Convai 的主类。

创建客户端

const client = new ConvaiClient();

你在调用时进行配置 connect().


连接中

await client.connect({
  apiKey: string;                    // 必需:您的 API 密钥
  characterId: string;                // 必需:角色 ID
  endUserId?: string;                 // 可选:用于记忆和分析
  url?: string;                       // 可选:自定义 API 端点
  enableVideo?: boolean;              // 启用视频/屏幕共享(默认:false)
  startWithVideoOn?: boolean;         // 启动时开启摄像头(默认:false)
  startWithAudioOn?: boolean;         // 启动时开启麦克风(默认:false)
  ttsEnabled?: boolean;               // 启用 TTS(默认:true)
  enableLipsync?: boolean;            // 启用 blendshape(默认:false)
  blendshapeConfig?: {
    format?: 'arkit' | 'mha';         // 形变格式(默认:'mha')
  };
  actionConfig?: {                    // 可选:角色动作
    actions: string[];
    characters: Array<{ name: string; bio: string }>;
    objects: Array<{ name: string; description: string }>;
    currentAttentionObject?: string;
  };
});

连接方法


消息发送


媒体控制

所有控制均为异步。


核心属性

最后更新于

这有帮助吗?