Skip to content

Daily Bots Web Demo showcasing how to build real-time voice AI agents 

Notifications You must be signed in to change notification settings

daily-demos/daily-bots-web-demo

Repository files navigation

Try Deploy

Daily Bots Demo

Example NextJS app that demonstrates core capabilities of Daily Bots.

Other demos

Getting started

Configure your local environment

cp env.example .env.local

NEXT_PUBLIC_BASE_URL defaults to /api, which is configured as Next server-side route handler. You can pass through service API keys, override service and config options within this route.

DAILY_BOTS_URL URL of the Daily Bots start endpoint (https://api.daily.co/v1/bots/start)

DAILY_API_KEY your Daily API key obtained by registering at https://bots.daily.co.

OPENAI_API_KEY Optional: provide a OpenAI API key. Daily Bots does not provide an integrated OpenAI service, so to use it, you will need to provide your own key. You can read more about integrated and 'bring your own key' here.

Install dependencies

yarn 

Run the project

yarn run dev

How does this work?

Daily Bots is built on two open-source technologies:

  • Pipecat - Python library for building real-time agent
  • RTVI - Open-standard for Real-Time Voice [and Video] Inference

This project makes use of realtime-ai, realtime-ai-react and realtime-ai-daily to interact with the Daily Bot.

Learn more about the RTVI web client libraries on the docs.

Configuration

All Voice Client configuration can be found in the rtvi.config.ts file. You can edit any prompts, services of config settings in this file.

API routes

This project exposes three server-side routes:

The routes project a secure way to pass any required secrets or configuration directly to the Daily Bots API. Your NEXT_PUBLIC_BASE_URL must point to your /api route and passed to the VoiceClient.

The routes are passed a config array and services map, which can be passed to the Daily Bots REST API, or modified securely.

Daily Bots https://api.daily.co/v1/bots/start has some required properties, which you can read more about here. You must set:

  • bot_profile
  • max_duration
  • config
  • services
  • Optional, if using OpenAI: api_keys