Introduction

The Interactions Protocol allows users to interact dynamically with the Replica live during an active conversation via broadcasting and receiving events.

Using the Interactions Protocol, you can:

  • Keep track of utterances spoken by the user or the replica
  • Overwrite the conversational context of the replica during an active conversation
  • Get the replica to echo the text you send it directly
  • Send external interrupts

Setup

The Interactions Protocol uses the Daily data channel to broadcast and receive events between the user and the replica.

To broadcast and listen for events, a Daily Call Client will need to be instantiated on the client side using a conversation_url.

Once a call client is created, an event listener can be created that takes action on receiving an app-message event.

By default, Tavus will broadcast utterance events once an utterance has been spoken by a user or a replica. This will allow the client to receive live transcription of what is occurring in the call.

Tavus will also broadcast tool call events when an LLM tool call should be made. This will allow the client to make calls to external APIs or databases.

The client is able to interact with the replica in real time by broadcasting an app-message to the Daily Room. Broadcasting a message can be accomplished by using sendAppMessage().

Upon receiving the message, the replica will act on the broadcasted message.


Schemas for the events can be found here:

Utterance Events

Conversational Context Overwrite

Echo Events

Interrupt Events

Respond Events

Tool Call Events