RELAYCall
Start an AI agent session on the call. The AI agent handles the conversation
using the provided prompt, tools, and configuration. Returns an
AIAction that you can use to stop
the AI session or wait for it to complete.
For building AI agents with the full framework (prompts, tools, skills, contexts),
use AgentBase. The ai() method
is for lower-level RELAY control where you configure the AI inline.
See also amazon_bedrock() for using Amazon Bedrock as the LLM backend.
This method executes the SWML ai verb on the call. See the
SWML AI reference for the full specification of all supported
parameters and behaviors.
Custom control ID. Auto-generated if not provided.
Fabric agent resource ID. When set, the AI uses a pre-configured agent from SignalWire Fabric instead of inline configuration.
The main prompt configuration.
The system prompt text that defines the AI agent’s behavior.
LLM temperature for the main prompt.
LLM top_p sampling parameter.
Post-prompt configuration for summarization or analysis after the conversation ends.
The post-prompt text.
URL to receive the post-prompt result via webhook.
Username for basic auth on the post-prompt webhook.
Password for basic auth on the post-prompt webhook.
Data accessible to the AI agent and SWAIG functions throughout the session.
Pronunciation rules for words or phrases the TTS engine should handle specially.
Speech recognition hints to improve accuracy for domain-specific terms.
Language configurations for multilingual support.
SWAIG (SignalWire AI Gateway) configuration for tool/function definitions.
Additional AI parameters such as barge_confidence, end_of_speech_timeout,
attention_timeout, and other LLM tuning settings.
Callback invoked when the AI session ends.
AIAction — An action handle with stop() and wait() methods.