Pre-Arrival Preference Collection
Gather guest preferences 48 hours before arrival to personalize their stay — from pillow types to dining reservations.
Why this matters
Deliver white-glove guest experiences at scale with automated reservation management, upsells, and disruption handling. This example shows you how to automate pre-arrival preference collection calls end-to-end with Guava's SDK — no telephony plumbing, no prompt engineering, just Python.
Installation
Install from Guava's private PyPI index. A public package is coming soon — the install command will simplify to pip install guava.
# Step 1: Install Guava
pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
# Public PyPI package coming soon — the install command will simplify to:
# pip install guava
# Step 2: Set your credentials
export GUAVA_API_KEY="..."
export GUAVA_AGENT_NUMBER="..."How it's built
Every Guava agent is a Python class. Walk through the key sections below, then grab the complete file at the end.
Imports
Import the Guava SDK and any helpers you need. guava.CallController is the base class for every voice agent.
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import osAgent setup
set_persona() defines how the agent presents itself. set_task() gives it its mission in plain English. The checklist drives the conversation — Guava works through it top-to-bottom, collecting Field values and speaking Say items as it goes.
class PreArrivalBot(guava.CallController):
def __init__(self, guest_name: str, hotel: str, arrival_date: str):
super().__init__()
self.set_persona(
organization_name=hotel,
agent_name="Chloe",
)
self.set_task(
objective=f"Collect pre-arrival preferences from {guest_name} arriving {arrival_date}",
checklist=[
f"Welcome {guest_name} and express excitement about their upcoming stay.",
guava.Field(
key="pillow_preference",
field_type="choice",
description="Pillow preference",
choices=["firm", "soft", "down alternative", "memory foam"],
),
guava.Field(
key="room_temperature",
field_type="choice",
description="Preferred room temperature on arrival",
choices=["cool (68°F)", "comfortable (72°F)", "warm (76°F)"],
),
guava.Field(
key="dietary_restrictions",
field_type="text",
description="Any dietary restrictions or food allergies?",
required=False,
),
guava.Field(
key="dinner_reservation",
field_type="bool",
description="Would they like a dinner reservation at our restaurant?",
),
guava.Field(
key="spa_appointment",
field_type="bool",
description="Interested in a spa appointment during their stay?",
),
"Confirm all preferences and wish them a wonderful upcoming stay.",
],
on_complete=lambda fields: print(f"Pre-arrival preferences logged for {guest_name}: {fields}"),
)
guava.dial(
controller=PreArrivalBot,
controller_args={"guest_name": "Isabella Fontaine", "hotel": "The Mayfair Grand",
"arrival_date": "Friday"},
to=os.environ["GUEST_PHONE"],
agent_number=os.environ["GUAVA_AGENT_NUMBER"],
api_key=os.environ["GUAVA_API_KEY"],
)Platform performance
<1s
Response time
99.99%
Uptime SLA
13+
Industries served
Full example
The complete file — copy it, save it as example.py, and run it.
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os
class PreArrivalBot(guava.CallController):
def __init__(self, guest_name: str, hotel: str, arrival_date: str):
super().__init__()
self.set_persona(
organization_name=hotel,
agent_name="Chloe",
)
self.set_task(
objective=f"Collect pre-arrival preferences from {guest_name} arriving {arrival_date}",
checklist=[
f"Welcome {guest_name} and express excitement about their upcoming stay.",
guava.Field(
key="pillow_preference",
field_type="choice",
description="Pillow preference",
choices=["firm", "soft", "down alternative", "memory foam"],
),
guava.Field(
key="room_temperature",
field_type="choice",
description="Preferred room temperature on arrival",
choices=["cool (68°F)", "comfortable (72°F)", "warm (76°F)"],
),
guava.Field(
key="dietary_restrictions",
field_type="text",
description="Any dietary restrictions or food allergies?",
required=False,
),
guava.Field(
key="dinner_reservation",
field_type="bool",
description="Would they like a dinner reservation at our restaurant?",
),
guava.Field(
key="spa_appointment",
field_type="bool",
description="Interested in a spa appointment during their stay?",
),
"Confirm all preferences and wish them a wonderful upcoming stay.",
],
on_complete=lambda fields: print(f"Pre-arrival preferences logged for {guest_name}: {fields}"),
)
guava.dial(
controller=PreArrivalBot,
controller_args={"guest_name": "Isabella Fontaine", "hotel": "The Mayfair Grand",
"arrival_date": "Friday"},
to=os.environ["GUEST_PHONE"],
agent_number=os.environ["GUAVA_AGENT_NUMBER"],
api_key=os.environ["GUAVA_API_KEY"],
)Run it
Start the agent. It will connect to Guava's infrastructure and begin accepting calls on your assigned number.
python example.py