reach_person()
For outbound calls, reach_person() handles the critical first step: confirming you have the right person on the line before proceeding. It automatically handles answering machines, gatekeepers, wrong numbers, and refusals.
signature
def reach_person(
contact_full_name: str,
*,
greeting: str | None = None,
outcomes: list[ReachPersonOutcome] | None = None,
)| Parameter | Type | Default | Description |
|---|---|---|---|
| contact_full_name | str | — | The full name of the person you're trying to reach. |
| greeting | str | None | None | Custom greeting message. Overrides the default introduction. |
| outcomes | list[ReachPersonOutcome] | None | None | Custom outcome routing. Defaults to a binary available/unavailable split. Use this to define additional outcomes (e.g. callback requested, wrong number, DNC). |
example.py
@agent.on_call_start
def on_call_start(call: guava.Call):
call.reach_person(
contact_full_name=call.get_variable("contact_name"),
)
@agent.on_reach_person
def on_reach_person(call: guava.Call, outcome: str):
if outcome == "unavailable":
call.hangup("Leave a brief voicemail asking them to call back.")
elif outcome == "available":
call.set_task(
"main_task",
checklist=[...],
)What happens on the call
When reach_person() is invoked, the agent automatically:
- Greets whoever answers and introduces itself (organization + purpose).
- Asks for the contact by name. If someone else answered, asks to speak with or be transferred to the contact.
- Determines availability and records the contact's availability in a
contact_availabilityfield. - Fires
agent.on_reach_personwith the outcome key ("available","unavailable", or a custom outcome if you providedoutcomes).
Common mistake: redundant introductions
Warning: By the time on_reach_person fires, the agent has already introduced itself and stated the purpose of the call. Do not re-introduce in the first task after reach_person.
# WRONG — redundant introduction
@agent.on_reach_person
def on_reach_person(call: guava.Call, outcome: str):
if outcome == "available":
call.set_task("survey", checklist=[
guava.Say("Hi, this is Grace from Acme Corp, I'm calling about..."), # Already said this
...
])
# RIGHT — go straight to content
@agent.on_reach_person
def on_reach_person(call: guava.Call, outcome: str):
if outcome == "available":
call.set_task("survey", checklist=[
guava.Say("I just have a few quick questions for you today."),
...
])Questions? hi@goguava.ai
def reach_person(
contact_full_name: str,
*,
greeting: str | None = None,
outcomes: list[ReachPersonOutcome] | None = None,
)@agent.on_call_start
def on_call_start(call: guava.Call):
call.reach_person(
contact_full_name=call.get_variable("contact_name"),
)
@agent.on_reach_person
def on_reach_person(call: guava.Call, outcome: str):
if outcome == "unavailable":
call.hangup("Leave a brief voicemail asking them to call back.")
elif outcome == "available":
call.set_task(
"main_task",
checklist=[...],
)# WRONG — redundant introduction
@agent.on_reach_person
def on_reach_person(call: guava.Call, outcome: str):
if outcome == "available":
call.set_task("survey", checklist=[
guava.Say("Hi, this is Grace from Acme Corp, I'm calling about..."), # Already said this
...
])
# RIGHT — go straight to content
@agent.on_reach_person
def on_reach_person(call: guava.Call, outcome: str):
if outcome == "available":
call.set_task("survey", checklist=[
guava.Say("I just have a few quick questions for you today."),
...
])