The Conversation object, its attributes, and methods.
Conversation
object (conv
) provides access to conversation data and tools for managing the agent’s behaviour. It handles state management, flow transitions, SMS interactions, environment details, and voice selection.
id
account_id
project_id
env
sip_headers
dict[str, str]
) provided by the carrier.Example:integration_attributes
dict[str, Any]
).
Only available inside the start
function.Example:caller_number
None
on chat channels.Example:callee_number
state
current_flow
None
.sms_queue
OutgoingSMS
/ OutgoingSMSTemplate
objects queued for dispatch at turn end.metrics_queue
variant_name
None
.variants
dict[str, Variant]
).variant
Variant
object for the active variant, or None
.Example:sms_templates
dict[str, SMSTemplate]
).Example:voice_change
TTSVoice
change requested this turn, or None
.language
"en"
).history
UserInput
and AgentResponse
events so far.Example:handoffs
dict[str, HandoffConfig]
).Example:transcript_alternatives
real_time_config
opening_hours
, fallback_number
, or flags for toggling logic between environments.Example:memory
conv.memory.get("key")
to access previously saved values across conversations. You can store new fields by assigning them to conv.state
if the field is listed in the Agent Memory config.Example:say
randomize_voice
goto_flow
exit_flow
set_variant
log_api_response
send_sms
send_sms_template
write_metric
call_handoff
reason
and utterance
fields:Parameter | Type | Description |
---|---|---|
destination | str | Handoff target key (e.g. "BillingQueue" ). Must be defined in your agent config. |
reason | str or None | Short code for escalation reason. Appears in Conversation Review and API. |
utterance | str or None | Spoken message just before transfer begins. Also appears in logs and Review. |
builtin-handoff
, the fields appear as config options.conv.call_handoff(...)
directly.