The Interactions Protocol allows users to interact dynamically with the Replica live during an active conversation via broadcasting interactions. The following interactions are available:

  • Text Echo interactions
  • Audio Echo interactions
  • Response interactions
  • Override conversation context interactions

In addition to interactions, users are able to listen to incoming events from the Replica. Specifically you can listen for:

  • Utterance events

Setting up Interactions Protocol

The interactions protocol uses the data-channel on WebRTC (Daily) in order to transmit and receive events between your server and CVI.

In order to use the interactions protocol, you must have a client that can connect to the data channel. We use Daily as our WebRTC provider, which makes it easy to setup a client.

The Daily app-message event is used to send and receive events and interactions between your server and CVI.

Here’s an example of using Daily Python to create a call client in Javascript:

call_client = None

class RoomHandler(EventHandler):
    def __init__(self):
        super().__init__()
    
    def on_app_message(self, message, sender: str) -> None:
        print(f"Incoming app message from {sender}: {message}")

def join_room(url):
    global call_client
    try:
        Daily.init()
        output_handler = RoomHandler()
        call_client = CallClient(event_handler=output_handler)
        call_client.join(url)
    except Exception as e:
        print(f"Error joining room: {e}")
        raise

def send_message(message):
    global call_client
    call_client.send_app_message(message)

Available Interactions

Available Events