Skip to content

daily-co/pipecat-crush-quest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipecat-crush-quest

A telephonic game to discover who likes you <3

Built using Pipecat, Pipecat Cloud, Gemini Live, and Twilio.

Demo

TL;DR: Call bots on the telephone and ask for clues about who has a crush on you.

Start the quest here

Table of Contents


High level 'How It Works'

  1. Purchase a phone number on Twilio and configure it to call a TwiML bin when it receives a call.
  2. Make a Pipecat bot using FastAPIWebsocketTransport for transport layer.
  3. Deploy bot to Pipecat Cloud (ensure there is a async def bot(runner_args: RunnerArguments) function).
  4. When someone calls that phone number, the TwiML tells Twilio to start a WebSocket stream to your bot.
  5. Audio streams between caller and your bot over the WebSocket connection.
  6. Profit. (or in Crush Quest's case, Enjoy.)

Directory Structure

  • /docs: files to publish game board website via GitHub Pages.
  • /game-board: code used to generate character images (Nano Banana) and QR Code.
  • /pc_bot: the Pipecat bot code. deploy to pipecatcloud from here.

Local Development

This is a bare-bones development environment with minimal dependencies (basically just Python 3.10+ and a Gemini API Key). It's not really "playable" in terms of the game, but it is super useful for experimenting with Pipecat code and prompts, etc.

Dependencies

  • Python 3.10+
  • uv package manager
  • Gemini API Key
    • [required] permissions to use Gemini Live model gemini-2.5-flash-native-audio-preview-09-2025
    • [optional] permissions to use Nano Banana (to generate new character images)

Setup

  1. Clone repo:
git clone https://github.com/daily-co/pipecat-crush-quest.git
cd crush-quest
  1. Set up a virtual environment and install dependencies:
cd pc_bot
uv sync
  1. Create an .env file and add API keys:
cp env.example .env

Call a bot character aka "Crush Potential"

from /pc_bot directory:

python bot.py --port <last four digits of phone number>

for example, Taylor's phone number is +1-337-333-8444. To talk to Taylor:

  1. run command python bot.py --port 8444
$ python bot.py --port 8444
==>
2025-10-08 10:44:44.726 | INFO     | pipecat:<module>:14 - ᓚᘏᗢ Pipecat 0.0.86 (Python 3.12.0 (main, Oct  2 2023, 20:56:14) [Clang 16.0.3 ]) ᓚᘏᗢ

🚀 Bot ready!
   → Open http://localhost:8444/client in your browser

Looking for dist directory at: /PATH/crush-quest/pc_bot/.venv/lib/python3.12/site-packages/pipecat_ai_small_webrtc_prebuilt/client/dist
INFO:     Started server process [14570]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://localhost:8444 (Press CTRL+C to quit)
  1. Navigate to http://localhost:8444 and click connect in the upper right corner.

  2. Talk to Taylor and ask who has a crush on you.

  3. After the call, Ctrl-C the server. To test a different character, say Chris, run:

python bot.py --port 8102

because Chris' phone number is +1-337-333-8102.


Configure Production

Prerequisites

Docker

Push to DockerHub so Pipecat Cloud can pull image.

  1. login to Docker
  2. Build / Tag / Push
  • Dockerfile has all the Pipecat Cloud goodies in it already.
export AGENT_NAME="crush-quest"
export DOCKER_USERNAME="yup"

docker build --platform=linux/arm64 -t $AGENT_NAME:latest .
docker tag $AGENT_NAME:latest $DOCKER_USERNAME/$AGENT_NAME:latest
docker push $DOCKER_USERNAME/$AGENT_NAME:latest

Note

Be aware, Docker repos are PUBLIC by default. Don't put .env in there.

Pipecat Cloud

Create agent on Pipecat Cloud platform.

  1. click + Deploy new agent button in the upper right corner.
  • Name: the Agent Name you chose. most likely crush-quest
  • Image: $DOCKER_USERNAME/$AGENT_NAME:latest ie, my_docker_username/crush-quest:latest

number-twiml

  • Image Pull Secret: used to pull the docker image. required by Pipecat Cloud.
  • click the Select... dropdown menu, then click + create number-twiml

Important

Auth Value your $DOCKER_USERNAME and your Docker password formatted like so: docker_username:docker_password More info on Image Pull Secrets here

  • Secret: this is where .env values go! You didn't copy them in your Dockerfile (way to go!), this is the safe place to add them.
  • click the Select... dropdown menu, then click + create

number-twiml

* click `Import .env file` and copy pasta your .env variables

number-twiml

  1. click Create agent

Note

Create agent deploys the agent, but it won't work without Twilio configured. Keep going...

  1. Add a credit card
  • Navigate to Settings > Billing or https://pipecat.daily.co/ORGANIZATION_NAME/settings/billing

Tip

Keep an eye on billing at https://pipecat.daily.co/ORGANIZATION_NAME/settings/invoices

Twilio

Create TwiML and configure telephony.

  1. Add to your .env:
  1. Purchase a phone number for each character aka "Crush Potential". Phone Numbers > Manage > Buy a number

  2. Create TwiML: Navigate to TwiML bin dashboard.

  3. Add this TwiML and name it pipecat-crush-quest:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Connect>
    <Stream url="wss://api.pipecat.daily.co/ws/twilio">
      <Parameter name="pipecatCrushQuestTo" value="{{To}}"/>
      <Parameter name="pipecatCrushQuestFrom" value="{{From}}"/>
      <Parameter name="_pipecatCloudServiceHost" value="AGENT_NAME.ORGANIZATION_NAME"/>
    </Stream>
  </Connect>
</Response>

twiml-twillio

AGENT_NAME is the name of the Pipecat bot.

  • Find it under the Agents tab in Pipecat Cloud dashboard, but it is most likely crush-quest.

ORGANIZATION_NAME is your Pipecat Cloud organization name.

  • Find the name in the dashboard URL: https://pipecat.daily.co/ORGANIZATION_NAME

more info about TwiML bins

  1. Configure phone numbers Configure each phone number to direct incoming calls to this TwiML. Use this same TwiML for every phone number.
  • Navigate to (Phone Numbers > Manage > Active numbers)
  • Select a phone number and in "Configure" tab, under “Voice Configuration” section, find “A call comes in” Set this dropdown to “TwiML Bin” and select the pipecat-crush-quest

number-twiml

> [!IMPORTANT] > Click `Save` at bottom of page to apply your changes - Repeat this for each phone number

Tip

Keep an eye on billing here.


Deploy to Production

Once the three pillars are configured (Docker, Pipecat Cloud, and Twilio), the app is deployed!

To re-deploy, build/tag/push the Docker image and deploy to Pipecat Cloud.

Docker

docker build --platform=linux/arm64 -t $AGENT_NAME:latest .
docker tag $AGENT_NAME:latest $DOCKER_USERNAME/$AGENT_NAME:latest
docker push $DOCKER_USERNAME/$AGENT_NAME:latest

Deploy to Pipecat Cloud via CLI

  1. Update pcc-deploy.toml with your docker username (and agent name if not crush-quest)
  2. Use pcc command line:
pcc auth login
pcc deploy

Deploy to Pipecat Clou via dashboard

  1. Navigate to Agents > crush-quest > Deployments
  2. Click + Add Deployment in the upper right corner.
  3. Navigate to Overview to monitor Deployment status

green-checkmarks

4. Green checkmarks mean you are good to call one of your Crush Potentials on the phone!

green-checkmarks

Troubleshooting

About

A telephonic game to discover who likes you, using Pipecat, Pipecat Cloud, Gemini Multimodal Live, and Twilio.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •