Attributes
id
id
Description: Unique identifier of the conversation.
Example:
account_id
account_id
Description: PolyAI account ID that owns this project.
Example:
project_id
project_id
Description: Project ID of the current agent.
Example:
env
env
Description: Current environment.
Values: “sandbox”, “pre-release”, “live”
Example:
channel_type
channel_type
Description: Type of channel the conversation is taking place on.
Values: “voice”, “webchat”, “whatsapp”, “sms”, “api”
Example:
attachments
attachments
Description: List of file attachments received or queued for sending (list[Attachment]).
Example:
sip_headers
sip_headers
Description: Dictionary of SIP headers (dict[str, str]) provided by the carrier.
Example:
integration_attributes
integration_attributes
Description: Metadata passed from an external integration (dict[str, Any]). Only available inside the start function.
Example:
integration_data
integration_data
Description: Combined payload of integration metadata and attributes (dict[str, Any]).
Example:
caller_number
caller_number
Description: Caller’s phone number in E.164 format, or None on chat channels. For inbound calls, this is the customer’s number; for outbound calls, the target number.
Example:
callee_number
callee_number
Description: Number dialled by the caller.
Example:
state
state
Description: Dictionary-like store that persists values across turns.
Example:
current_flow
current_flow
Description: Name of the flow currently executing, or None.
current_step
current_step
Description: Step name currently executing within the active flow.
Example:
sms_queue
sms_queue
Description: List of
OutgoingSMS / OutgoingSMSTemplate objects queued for dispatch at turn end.metrics_queue
metrics_queue
Description: List of custom metrics queued for analytics.
metric_events
metric_events
Description: List of metric event objects queued for analytics.
Example:
variant_name
variant_name
Description: Name of the active variant, or None.
variants
variants
Description: Dictionary of all variant definitions (dict[str, Variant]).
variant
variant
Description: Variant object for the active variant, or None.
Example:
sms_templates
sms_templates
Description: Dictionary of SMS templates (dict[str, SMSTemplate]).
Example:
voice_change
voice_change
Description: Pending TTSVoice change requested this turn, or None.
language
language
Description: ISO-639 language code configured for the project (e.g. “en”).
history
history
Description: Chronological list of UserInput and AgentResponse events so far.
Example:
handoffs
handoffs
Description: Dictionary of configured hand-off destinations (dict[str, HandoffConfig]).
Example:
transcript_alternatives
transcript_alternatives
Description: List of ASR alternatives for the last user utterance.
Example:
real_time_config
real_time_config
Description: Returns a dictionary of real-time configuration values defined in Configuration Builder.
Example:
memory
memory
Description: Dictionary of memory fields previously stored for the caller, retrieved from Agent Memory. The identifier used to retrieve memory is typically caller_number for voice or the integration key for chat.
Example:
Methods
say
say
Description: Override the next utterance.
Example:
randomize_voice
randomize_voice
Description: Randomly choose a voice based on weighted probabilities. See Voice Selection docs for available voices.
Example:
goto_flow
goto_flow
Description: Transition to another flow at turn end.
Example:
exit_flow
exit_flow
Description: Exit the current flow.
Example:
set_variant
set_variant
Description: Manually set the active variant.
Example:
add_attachments
add_attachments
Description: Attach one or more files to the current conversation record.
Example:
discard_recording
discard_recording
Description: Prevents saving the current call recording, e.g. when sensitive data is detected.
Example:
generate_external_events
generate_external_events
Description: Sends a structured webhook event to the configured external endpoint.
Example:
log_api_response
log_api_response
Description: Logs an external API response for visibility in Conversation Review → Diagnosis and the analytics pipeline.
Example:
send_email
send_email
Description: Sends an email using the configured outbound mail service (SMTP or SES).
Example:
send_whatsapp
send_whatsapp
Description: Sends a WhatsApp message via the configured WhatsApp Business API integration.
Example:
send_content_template
send_content_template
Description: Sends a WhatsApp or SMS template message defined in your content templates.
Example:
send_sms
send_sms
Description: Queue a plain-text SMS.
Example:
send_sms_template
send_sms_template
Description: Queue a pre-configured SMS template.
Example:
write_metric
write_metric
Description: Write a custom metric to the analytics pipeline.
Example:
call_handoff
call_handoff
Description: Transfer the call to a configured handoff destination.
Parameters: destination (str) – handoff target key; reason (str or None) – escalation reason; utterance (str or None) – message before transfer.
Example:Where it shows up: In flows using builtin-handoff or via functions; visible in Conversation Review and API.
utils
utils
Description: Provides helper functions for extracting structured data from user input, such as postal addresses, names, or city references.
Example:

