BedrockAgent
BedrockAgent extends AgentBase to use Amazon Bedrock’s
voice-to-voice model as the AI backend. It renders SWML with the
amazon_bedrock verb instead of ai, and keeps every standard agent feature:
text and POM prompts, skills, SWAIG functions, post-prompt, and dynamic
configuration.
Extends AgentBase — inherits all parent properties and methods.
BedrockAgent generates SWML with the amazon_bedrock verb
instead of ai. See the SWML bedrock reference for the
full specification.
Constructor
The createBedrockAgent(config) factory function returns the same instance as
new BedrockAgent(config).
Constructor parameters
name
Agent name.
route
HTTP route for the agent endpoint.
systemPrompt
Initial system prompt, set as raw text. Can be overridden later with
setPromptText(). Leave it unset if you build the prompt from sections with
promptAddSection(), because raw text takes precedence over sections.
voiceId
Bedrock voice identifier ("tiffany", "matthew", "amy", "lupe", or "carlos").
temperature
Generation temperature. Range: 0 to 2. A numeric string is converted, and a SWML
variable reference such as '${temperature}' is kept; anything else throws.
topP
Nucleus sampling parameter. Range: 0 to 1. A numeric string is converted, and a SWML variable reference is kept; anything else throws.
maxTokens
Maximum tokens to generate per response, an integer or a numeric string. Sent in
the prompt as max_tokens, but the platform’s Bedrock session doesn’t apply it.
agentOptions
Additional AgentBase constructor options (e.g., host,
port, basicAuth).
Methods
Overridden behavior
BedrockAgent overrides several AgentBase methods to fit the Bedrock voice-to-voice model:
The amazon_bedrock verb carries the prompt, SWAIG functions, params, global data,
and post-prompt settings. Speech hints, languages, pronunciation rules, multilingual
settings, and contexts aren’t part of it, so they’re left out of the SWML, with one
warning per agent for each. The platform’s Bedrock session reads only the prompt’s
text, voice_id, temperature, and top_p.
Prompt methods (setPromptText(), setPromptPom(), promptAddSection(), and
so on) work normally. The prompt is built the same way as in AgentBase and then
placed in the amazon_bedrock verb, with voice_id, temperature, and top_p
added to the prompt object itself. Raw text set through systemPrompt or
setPromptText() takes precedence: when it is present, sections added with
promptAddSection() are not rendered. Use one style or the other for a given
agent.