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 (e.g., "matthew", "joanna").
temperature
Generation temperature. Range: 0 to 1.
topP
Nucleus sampling parameter. Range: 0 to 1.
maxTokens
Maximum tokens to generate per response. Accepted for compatibility with the Python SDK. Not currently applied to the call.
agentOptions
Additional AgentBase constructor options (e.g., host,
port, basicAuth).
Methods
Set the Bedrock voice ID after construction.
Update Bedrock inference parameters.
Overridden behavior
BedrockAgent overrides several AgentBase methods to fit the Bedrock voice-to-voice model:
Parameters specific to text-based LLMs (barge_confidence, presence_penalty,
frequency_penalty) are filtered out during SWML rendering and have no effect
on Bedrock agents.
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.