reach person.md
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.
def reach_person(
contact_full_name: str,
*,
greeting: str | None = None,
voicemail_message: str | None = None,
voicemail_hangup: bool = False,
outcomes: list[ReachPersonOutcome] | None = None,
)
reachPerson(
contactFullName: string,
options?: {
greeting?: string;
voicemailMessage?: string;
voicemailHangup?: boolean;
outcomes?: ReachPersonOutcome[];
},
): Promise<void>
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. The five default outcomes are:"available"— the intended contact is on the line."unavailable"— someone else or an IVR answered and the contact could not be reached."voicemail"— an answering machine or voicemail system was reached."wrong_number"— the number does not belong to the contact."do_not_contact"— the contact asked not to be called again.
If you provided custom outcomes, those are used instead.
Voicemail handling
Warning:
reach_person()andset_voicemail_action()both handle voicemail and cannot be used together. If you setvoicemail_messageorvoicemail_hanguponreach_person(), do not callset_voicemail_action()— and vice versa. Using both raises an error.
Common mistake: redundant introductions
Warning: By the time
on_reach_personfires, the agent has already introduced itself and stated the purpose of the call. Do not re-introduce in the first task afterreach_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."),
...
])