A handle to a live call, passed to your Guava.Agent handlers.
Use it to steer the conversation: assign tasks, set the persona, send instructions, transfer, read collected fields, and more. Every mutating function enqueues a command on the call's WebSocket connection.
Summary
Functions
Provide the agent contextual information about a topic.
The call's Guava.CallInfo.
The default set of reach_person outcomes.
Read a collected field value by key.
Read a call-scoped variable.
Instruct the agent to naturally end the conversation and hang up.
Whether a field has been collected.
The call's session id.
Reach a specific contact on an outbound call and record their availability
in the contact_availability field. React to the outcome in
Guava.Agent.handle_task_complete/3 (task id "reach_person"), reading the
contact_availability field with get_field/2.
Have the agent read a script verbatim.
Ask the agent to retry the current task.
Send an arbitrary command struct on this call.
Press a sequence of DTMF digits on the call (e.g. to navigate an IVR).
Send a free-form instruction to steer the agent.
Enable or disable the agent pressing DTMF digits. Not supported on WebRTC calls.
Set primary and secondary spoken languages.
Set the agent's persona.
Assign a task: an objective and/or a checklist of items.
Store a JSON-serializable, call-scoped variable.
Transfer the call to a destination (phone number or SIP address).
Types
@type t() :: %Guava.Call{ call_info: Guava.CallInfo.t(), emit: (map() -> :ok) | nil, id: String.t(), server: pid(), table: :ets.tid() }
Functions
Provide the agent contextual information about a topic.
@spec call_info(t()) :: Guava.CallInfo.t()
The call's Guava.CallInfo.
The default set of reach_person outcomes.
Read a collected field value by key.
Read a call-scoped variable.
Instruct the agent to naturally end the conversation and hang up.
Whether a field has been collected.
The call's session id.
Reach a specific contact on an outbound call and record their availability
in the contact_availability field. React to the outcome in
Guava.Agent.handle_task_complete/3 (task id "reach_person"), reading the
contact_availability field with get_field/2.
Options
:greeting— verbatim opening line.:voicemail_message— leave this message on voicemail, then hang up.:voicemail_hangup— hang up immediately on voicemail (no message).:outcomes— override the availability outcomes (list of maps with:key, optional:description, optional:next_action_preview).
Have the agent read a script verbatim.
Ask the agent to retry the current task.
Send an arbitrary command struct on this call.
Called from one of your handlers, the command is transmitted immediately, so commands you issue reach the server in the order you issued them — before any reply the runtime sends for the event being handled.
Press a sequence of DTMF digits on the call (e.g. to navigate an IVR).
digits may be a string like "123" or a list of single-digit strings. Each
digit must be a valid DTMF digit (see Guava.Types.dtmf_digits/0). Not supported
on WebRTC calls.
Send a free-form instruction to steer the agent.
Enable or disable the agent pressing DTMF digits. Not supported on WebRTC calls.
Set primary and secondary spoken languages.
Set the agent's persona.
Options
:organization_name, :agent_name, :agent_purpose, :voice.
Assign a task: an objective and/or a checklist of items.
Checklist items may be Guava.Field structs, Guava.Say, Guava.Todo, or
plain strings (converted to todos).
Store a JSON-serializable, call-scoped variable.
Transfer the call to a destination (phone number or SIP address).
instructions (optional) tells the agent what to say; when omitted the
agent announces a transfer before connecting. This is always a soft transfer.