Demos
See Guava in action.
Working code examples across real industry scenarios. Every demo starts from a fresh install — copy, customize, and run.
Annual Wellness Visit Scheduling
An agent calls a Medicare member on behalf of their health plan, verifies identity, and books their annual wellness visit using a calendar_slot Field. Appointment written to the EHR, SMS confirmation sent after the call.
import guava
import os
from guava.helpers.openai import DatetimeFilter
from guava.examples.mock_appointments import MOCK_APPOINTMENTS
class WellnessVisitController(guava.CallController):
def __init__(self, member_name):
super().__init__()
self.datetime_filter = DatetimeFilter(source_list=MOCK_APPOINTMENTS)
self.set_persona(
organization_name="Green Shield Health",
agent_name="Ava",
agent_purpose=f"Calling {member_name} to book their annual wellness visit",
)
self.reach_person(
contact_full_name=member_name,
on_success=self.schedule_recipient,
on_failure=self.recipient_unavailable,
)
def schedule_recipient(self):
self.set_task(
checklist=[
guava.Say("Let me check what times we have available."),
guava.Field(
key="appointment_time",
field_type="calendar_slot",
description="Find a time that works for the member",
choice_generator=lambda q: self.datetime_filter.filter(q, max_results=3),
),
"Confirm the appointment and say goodbye.",
],
on_complete=self.end_call,
)
def end_call(self):
self.hangup(final_instructions="Thank them and hang up.")
def recipient_unavailable(self):
self.hangup(final_instructions="Apologize and hang up.")
if __name__ == "__main__":
guava.Client().create_outbound(
from_number=os.environ["GUAVA_AGENT_NUMBER"],
to_number="+1...",
call_controller=WellnessVisitController("Jane Smith"),
)Pharmacy Override
An agent handles a pharmacy override call. It verifies the patient and prescription, confirms the prescriber and reason, processes the override, and documents the outcome for the pharmacist.
import guava
import os
class PharmacyOverrideController(guava.CallController):
def __init__(self, patient_name: str, medication: str):
super().__init__()
self.patient_name = patient_name
self.medication = medication
self.set_persona(
organization_name="Cedar Pharmacy",
agent_name="Sam",
agent_purpose=(
f"calling {patient_name} about an override on their {medication} prescription"
),
)
self.reach_person(
contact_full_name=patient_name,
on_success=self.handle_override,
on_failure=self.recipient_unavailable,
)
def handle_override(self):
self.set_task(
objective=f"Process the pharmacy override for {self.patient_name}'s {self.medication}.",
checklist=[
guava.Say(
f"Hi {self.patient_name}, this is Sam from Cedar Pharmacy calling about your "
f"{self.medication} prescription."
),
guava.Field(key="identity_confirmed", field_type="text",
description="Confirm date of birth matches the patient on file"),
guava.Field(key="override_reason", field_type="text",
description="Reason for the override (e.g. refill-too-soon, prior auth)"),
guava.Field(key="prescriber_confirmed", field_type="text",
description="Confirm the prescribing provider"),
"Tell the patient the override has been submitted and what happens next.",
],
on_complete=self.end_call,
)
def end_call(self):
self.hangup(final_instructions="Summarize the override outcome and thank them.")
def recipient_unavailable(self):
self.hangup(final_instructions="Leave a brief voicemail asking them to call the pharmacy back.")
if __name__ == "__main__":
guava.Client().create_outbound(
from_number=os.environ["GUAVA_AGENT_NUMBER"],
to_number="+1...",
call_controller=PharmacyOverrideController("Jane Smith", "atorvastatin"),
)Patient Billing & Payment
An agent calls a patient about an outstanding balance, explains the charges, captures a payment arrangement over the phone, and routes the remaining balance to a financial counselor.
import guava
import os
class PatientBillingController(guava.CallController):
def __init__(self, patient_name: str, balance: str):
super().__init__()
self.patient_name = patient_name
self.balance = balance
self.set_persona(
organization_name="Valley Health",
agent_name="Robin",
agent_purpose=(
f"calling {patient_name} about an outstanding balance of {balance}"
),
)
self.reach_person(
contact_full_name=patient_name,
on_success=self.handle_balance,
on_failure=self.recipient_unavailable,
)
def handle_balance(self):
self.set_task(
objective=f"Resolve {self.patient_name}'s outstanding balance of {self.balance}.",
checklist=[
guava.Say(
f"Hi {self.patient_name}, this is Robin from Valley Health about your "
f"account balance."
),
guava.Field(key="identity_confirmed", field_type="text",
description="Confirm date of birth matches the patient on file"),
guava.Field(key="payment_today", field_type="text",
description="Amount the patient can pay today"),
guava.Field(key="remaining_plan", field_type="text",
description="How the patient wants to handle the remaining balance"),
"Confirm the payment arrangement and that the remaining balance routes to a financial counselor.",
],
on_complete=self.end_call,
)
def end_call(self):
self.hangup(final_instructions="Summarize the arrangement and thank them.")
def recipient_unavailable(self):
self.hangup(final_instructions="Leave a brief voicemail asking them to call the billing office back.")
if __name__ == "__main__":
guava.Client().create_outbound(
from_number=os.environ["GUAVA_AGENT_NUMBER"],
to_number="+1...",
call_controller=PatientBillingController("Jane Smith", "$642.50"),
)Ready to run your first call?
Install the SDK and have a voice agent running in under 10 minutes.