tavus-cvi-quickstart

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tavus CVI Quick Start

Tavus CVI 快速入门

Get a real-time AI video conversation running in minutes.
几分钟内启动实时AI视频对话。

Fastest Path: Use Stock Resources

最快路径:使用预置资源

bash
curl -X POST https://tavusapi.com/v2/conversations \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "replica_id": "rfe12d8b9597",
    "persona_id": "pdced222244b"
  }'
Response:
json
{
  "conversation_id": "c123456",
  "conversation_url": "https://tavus.daily.co/c123456",
  "status": "active"
}
Open
conversation_url
in browser to join the call.
bash
curl -X POST https://tavusapi.com/v2/conversations \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "replica_id": "rfe12d8b9597",
    "persona_id": "pdced222244b"
  }'
响应:
json
{
  "conversation_id": "c123456",
  "conversation_url": "https://tavus.daily.co/c123456",
  "status": "active"
}
在浏览器中打开
conversation_url
即可加入通话。

Stock Resources

预置资源

Replicas (the visual avatar):
  • rfe12d8b9597
    - Default
  • re8e740a42
    - Nathan
Personas (behavior/personality):
  • pdced222244b
    - Default
  • p24293d6
    - Celebrity DJ
Replica(虚拟形象):
  • rfe12d8b9597
    - 默认形象
  • re8e740a42
    - Nathan
Persona(行为/性格设定):
  • pdced222244b
    - 默认设定
  • p24293d6
    - 名人DJ

Create Custom Persona + Conversation

创建自定义Persona + 对话

Step 1: Create Persona

步骤1:创建Persona

bash
curl -X POST https://tavusapi.com/v2/personas \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "persona_name": "Sales Coach",
    "pipeline_mode": "full",
    "system_prompt": "You are a friendly sales coach helping reps practice cold calls. Ask probing questions and give constructive feedback.",
    "context": "Focus on B2B SaaS sales scenarios.",
    "default_replica_id": "rfe12d8b9597"
  }'
Response:
json
{
  "persona_id": "p123456",
  "persona_name": "Sales Coach"
}
bash
curl -X POST https://tavusapi.com/v2/personas \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "persona_name": "Sales Coach",
    "pipeline_mode": "full",
    "system_prompt": "You are a friendly sales coach helping reps practice cold calls. Ask probing questions and give constructive feedback.",
    "context": "Focus on B2B SaaS sales scenarios.",
    "default_replica_id": "rfe12d8b9597"
  }'
响应:
json
{
  "persona_id": "p123456",
  "persona_name": "Sales Coach"
}

Step 2: Start Conversation

步骤2:启动对话

bash
curl -X POST https://tavusapi.com/v2/conversations \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "persona_id": "p123456",
    "conversation_name": "Practice Session"
  }'
bash
curl -X POST https://tavusapi.com/v2/conversations \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "persona_id": "p123456",
    "conversation_name": "Practice Session"
  }'

Conversation Options

对话选项

json
{
  "persona_id": "p123456",
  "replica_id": "rfe12d8b9597",
  "conversation_name": "Demo Call",
  "conversational_context": "User is interested in enterprise pricing.",
  "custom_greeting": "Hi! I'm excited to help you today.",
  "callback_url": "https://your-webhook.com/tavus",
  "properties": {
    "enable_recording": true,
    "max_duration": 600
  }
}
json
{
  "persona_id": "p123456",
  "replica_id": "rfe12d8b9597",
  "conversation_name": "Demo Call",
  "conversational_context": "User is interested in enterprise pricing.",
  "custom_greeting": "Hi! I'm excited to help you today.",
  "callback_url": "https://your-webhook.com/tavus",
  "properties": {
    "enable_recording": true,
    "max_duration": 600
  }
}

End Conversation

结束对话

bash
curl -X POST https://tavusapi.com/v2/conversations/{conversation_id}/end \
  -H "x-api-key: YOUR_API_KEY"
bash
curl -X POST https://tavusapi.com/v2/conversations/{conversation_id}/end \
  -H "x-api-key: YOUR_API_KEY"

Key Concepts

核心概念

ConceptWhat it is
ReplicaThe visual avatar (face, appearance)
PersonaBehavior, voice, LLM config, system prompt
ConversationA live WebRTC session combining replica + persona
概念定义
Replica虚拟形象(面部、外观)
Persona行为、语音、LLM配置、系统提示词
Conversation结合Replica与Persona的实时WebRTC会话

Pipeline Modes

管道模式

  • full
    - Complete CVI with perception, STT, LLM, TTS (recommended)
  • echo
    - Bypass LLM, replica speaks what you send directly
  • audio
    - Audio-only, no video
  • full
    - 完整CVI,包含感知、STT、LLM、TTS(推荐)
  • echo
    - 绕过LLM,Replica直接复述你发送的内容
  • audio
    - 仅音频,无视频

Latency

延迟

~600ms utterance-to-utterance response time with full pipeline.
完整管道下,话语到话语的响应时间约为600ms。

Next Steps

后续步骤

  • tavus-cvi-persona - Deep dive on persona configuration
  • tavus-cvi-ui - React component integration
  • tavus-cvi-interactions - Control conversations programmatically
  • tavus-cvi-knowledge - Add knowledge base and memories
  • tavus-cvi-persona - 深入了解Persona配置
  • tavus-cvi-ui - React组件集成
  • tavus-cvi-interactions - 以编程方式控制对话
  • tavus-cvi-knowledge - 添加知识库与记忆功能