Loading...
Loading...
Control Tavus CVI conversations in real-time using the Interactions Protocol. Use when sending text for the replica to speak (echo), interrupting the replica, injecting context mid-conversation, handling tool calls, or listening to conversation events via WebRTC/Daily.
npx skill4agent add tavus-engineering/tavus-skills tavus-cvi-interactions<script src="https://unpkg.com/@daily-co/daily-js"></script>
<script>
const call = window.Daily.createFrame();
// Listen for events from CVI
call.on('app-message', (event) => {
console.log('CVI event:', event.data);
});
// Join the conversation
call.join({ url: 'YOUR_CONVERSATION_URL' });
// Send interaction
function send(interaction) {
call.sendAppMessage(interaction, '*');
}
</script>send({
"message_type": "conversation",
"event_type": "conversation.echo",
"conversation_id": "YOUR_CONVERSATION_ID",
"properties": {
"modality": "text",
"text": "Hello! Let me tell you about our product."
}
});send({
"message_type": "conversation",
"event_type": "conversation.echo",
"conversation_id": "YOUR_CONVERSATION_ID",
"properties": {
"modality": "audio",
"audio": "BASE64_ENCODED_AUDIO",
"sample_rate": 24000,
"inference_id": "unique-id",
"done": "true"
}
});send({
"message_type": "conversation",
"event_type": "conversation.respond",
"conversation_id": "YOUR_CONVERSATION_ID",
"properties": {
"text": "What are your pricing plans?"
}
});send({
"message_type": "conversation",
"event_type": "conversation.interrupt",
"conversation_id": "YOUR_CONVERSATION_ID"
});send({
"message_type": "conversation",
"event_type": "conversation.overwrite_context",
"conversation_id": "YOUR_CONVERSATION_ID",
"properties": {
"context": "User is now asking about enterprise features."
}
});send({
"message_type": "conversation",
"event_type": "conversation.append_context",
"conversation_id": "YOUR_CONVERSATION_ID",
"properties": {
"context": "User mentioned they have a team of 50 people."
}
});send({
"message_type": "conversation",
"event_type": "conversation.sensitivity",
"conversation_id": "YOUR_CONVERSATION_ID",
"properties": {
"participant_pause_sensitivity": "high",
"participant_interrupt_sensitivity": "low"
}
});lowmediumhigh{
"event_type": "conversation.utterance",
"properties": {
"role": "user",
"content": "Tell me about your product"
}
}userreplica{
"event_type": "conversation.replica.started_speaking",
"properties": {
"inference_id": "inf-123"
}
}{
"event_type": "conversation.replica.stopped_speaking",
"properties": {
"inference_id": "inf-123",
"duration": 4.5
}
}{
"event_type": "conversation.user.started_speaking"
}{
"event_type": "conversation.tool_call",
"properties": {
"tool_name": "get_weather",
"arguments": {
"location": "San Francisco, CA"
},
"inference_id": "inf-123"
}
}{
"event_type": "conversation.perception_analysis",
"properties": {
"analysis": "User appears engaged, smiling, looking at camera"
}
}{
"event_type": "conversation.replica.interrupted",
"properties": {
"inference_id": "inf-123"
}
}from daily import Daily, CallClient
Daily.init()
client = CallClient()
def on_app_message(message, sender):
print(f"Received: {message}")
client.set_user_name("bot")
client.join(meeting_url, completion=on_join)
# Send interaction
client.send_app_message({
"message_type": "conversation",
"event_type": "conversation.echo",
"conversation_id": "xxx",
"properties": {"text": "Hello!"}
})pipeline_mode: "echo"conversation.echoconversation.interruptpipeline_mode: "full"conversation.append_contextconversation.echoconversation.interruptconversation.echo