amazon_bedrock
amazon_bedrock
Create an Amazon Bedrock agent with a prompt. Since the text prompt is central to getting great results out of the AI, it is highly recommended that you also read the prompt engineering guide.
Properties
amazon_bedrock
An object that accepts the following properties.
amazon_bedrock.global_data
Initial data shared by all of the agent’s SWAIG functions. It is sent with every function call to your web_hook_url,
is available to data_map templates under session_data.global_data, and is included in the post-prompt
summary report. The set_global_data and unset_global_data actions change it during the call.
amazon_bedrock.params
A JSON object containing parameters as key-value pairs.
amazon_bedrock.post_prompt
Optional instructions for the summary written when the conversation ends, as a text string or a pom object array.
When omitted, a default summary instruction is used. Has no effect unless post_prompt_url is set.
See post_prompt details below.
amazon_bedrock.post_prompt_url
The URL that receives the conversation summary report when the conversation ends. The summary is written only when
this is set. Authentication can also be set in the url in the format of username:password@url.
See post_prompt_url callback below.
amazon_bedrock.prompt
Establishes the initial set of instructions and settings to configure the agent.
See prompt for additional details.
amazon_bedrock.SWAIG
An object containing the user-defined functions the agent can call during the dialogue and their defaults.
See SWAIG for additional details.
post_prompt
The post_prompt object holds the instructions for the end-of-call summary, as either plain text or a structured POM
prompt. The summary is written with fixed model settings, so post_prompt takes no tuning parameters. Set either text or
pom, not both. If a document sets both at runtime, text is used.
Regular prompt
POM prompt
post_prompt.text
The instructions for writing the summary of the conversation.
post_prompt_url callback
SignalWire sends the report to your post_prompt_url as an HTTP POST. Unlike the ai method’s
post-prompt report, this request is not signed, so protect the endpoint with basic auth credentials
embedded in the URL, in the form username:password@url. See
Verify SWML request signatures.
See the Amazon Bedrock post-prompt callback webhook page for the full field reference.
Responding to post prompt requests
Answer with any 2xx status. The body is not read, so {"response": "ok"} is as good as an empty
one.
Amazon Bedrock example
The following example selects Bedrock’s Tiffany voice using the voice_id parameter in the prompt. It includes scaffolding for a post_prompt_url as well as several remote and inline functions using SWAIG.