Lease-End Outreach
Contact customers 4-6 months before lease end to discuss return, buyout, or renewal options and get them back in the showroom.
Why this matters
Automate service scheduling, recall notifications, lease-end outreach, and financing workflows across your dealership network. This example shows you how to automate lease-end outreach 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 LeaseEndBot(guava.CallController):
def __init__(self, customer_name: str, vehicle: str, lease_end_date: str,
residual_value: float, buyout_price: float):
super().__init__()
self.set_persona(
organization_name="AutoNation Lease Services",
agent_name="Alex",
)
self.set_task(
objective=f"Discuss lease-end options with {customer_name} for their {vehicle}, lease ending {lease_end_date}",
checklist=[
f"Greet {customer_name} and mention their {vehicle} lease ends {lease_end_date} — 90 days away.",
guava.Say(f"Three options: return the vehicle, purchase for ${buyout_price:.2f}, or lease a new model."),
guava.Field(
key="preferred_option",
field_type="choice",
description="Which option is the customer leaning toward?",
choices=["return vehicle", "purchase current vehicle", "lease new vehicle",
"need more time to decide"],
),
guava.Field(
key="mileage_overage",
field_type="bool",
description="Are they expecting to be over their mileage allowance?",
),
guava.Field(
key="wants_appointment",
field_type="bool",
description="Would they like to come in to discuss options in person?",
),
guava.Field(
key="appointment_slot",
field_type="calendar_slot",
description="Preferred showroom appointment time",
required=False,
choice_generator=lambda: ["Sat 10am", "Sat 2pm", "Sun 12pm", "Next weekday morning"],
),
"Confirm next steps and send lease-end guide.",
],
on_complete=lambda fields: print(f"Lease-end: {customer_name} preference: {fields.get('preferred_option')}"),
)
guava.dial(
controller=LeaseEndBot,
controller_args={"customer_name": "Jennifer Walsh", "vehicle": "2022 BMW 3 Series",
"lease_end_date": "June 30", "residual_value": 28400.00, "buyout_price": 27200.00},
to=os.environ["CUSTOMER_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 LeaseEndBot(guava.CallController):
def __init__(self, customer_name: str, vehicle: str, lease_end_date: str,
residual_value: float, buyout_price: float):
super().__init__()
self.set_persona(
organization_name="AutoNation Lease Services",
agent_name="Alex",
)
self.set_task(
objective=f"Discuss lease-end options with {customer_name} for their {vehicle}, lease ending {lease_end_date}",
checklist=[
f"Greet {customer_name} and mention their {vehicle} lease ends {lease_end_date} — 90 days away.",
guava.Say(f"Three options: return the vehicle, purchase for ${buyout_price:.2f}, or lease a new model."),
guava.Field(
key="preferred_option",
field_type="choice",
description="Which option is the customer leaning toward?",
choices=["return vehicle", "purchase current vehicle", "lease new vehicle",
"need more time to decide"],
),
guava.Field(
key="mileage_overage",
field_type="bool",
description="Are they expecting to be over their mileage allowance?",
),
guava.Field(
key="wants_appointment",
field_type="bool",
description="Would they like to come in to discuss options in person?",
),
guava.Field(
key="appointment_slot",
field_type="calendar_slot",
description="Preferred showroom appointment time",
required=False,
choice_generator=lambda: ["Sat 10am", "Sat 2pm", "Sun 12pm", "Next weekday morning"],
),
"Confirm next steps and send lease-end guide.",
],
on_complete=lambda fields: print(f"Lease-end: {customer_name} preference: {fields.get('preferred_option')}"),
)
guava.dial(
controller=LeaseEndBot,
controller_args={"customer_name": "Jennifer Walsh", "vehicle": "2022 BMW 3 Series",
"lease_end_date": "June 30", "residual_value": 28400.00, "buyout_price": 27200.00},
to=os.environ["CUSTOMER_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