Lifecycle
An overview of the lifecycle of a Daily Bot
Overview
The general flow for a Daily Bot is as follows:
Client is initialized
The client application creates an RTVI component, called the DailyVoiceClient
with the configuration for which type of bot (AI Agent) to launch, what settings and an internal endpoint to connect to.
Client is started
The client application calls start()
on the DailyVoiceClient
.
The internal endpoint is triggered
The DailyVoiceClient
connects to the internal endpoint and sends the configuration and settings.
Call Daily's bots/start endpoint is called
The internal endpoint uses a stored Daily API Key to forward the configuration and settings to the Daily Bots REST endpoint (/bots/start).
Bot Launches
The Daily Bots REST endpoint launches the AI Agent in the cloud.
Communication Begins
The AI Agent connects directly to the DailyVoiceClient
and the client application can now interact with the AI Agent.
The AI Agent will remain active until the client application calls disconnect()
on the DailyVoiceClient
or a max duration is reached. The AI Agent will then be shut down and the connection will be closed.