Skip to main content

amazon_bedrock

Create an Amazon Bedrocl 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 Prompting Best Practices guide.

NameTypeDefaultDescription
amazon_bedrockRequiredobject-An object that contains the Amazon Bedrock parameters.

Amazon Bedrock parameters​

NameTypeDefaultDescription
global_dataOptionalobject-A powerful and flexible environmental variable which can accept arbitrary data that is set initially in the SWML script or from the SWML set_global_data action. This data can be referenced globally. All contained information can be accessed and expanded within the prompt - for example, by using a template string.
paramsOptionalobject-A JSON object containing parameters as key-value pairs.
post_promptOptionalobject-The final set of instructions and configuration settings to send to the agent.
post_prompt_urlOptionalstring-The URL to which to send status callbacks and reports. Authentication can also be set in the url in the format of username:password@url.
promptRequiredobject-Establishes the initial set of instructions and settings to configure the agent.
SWAIGOptionalobject-An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue.

Amazon Bedrock example​

---
version: 1.0.0
sections:
main:
- amazon_bedrock:
post_prompt_url: https://example.com/my-api
prompt:
text: |
You are a helpful assistant that can provide information to users about a destination.
At the start of the conversation, always ask the user for their name.
You can use the appropriate function to get the phone number, address,
or weather information.
post_prompt:
text: Summarize the conversation.
SWAIG:
includes:
- functions:
- get_phone_number
- get_address
url: https://example.com/functions
defaults:
web_hook_url: https://example.com/my-webhook
functions:
- function: get_weather
description: To determine what the current weather is in a provided location.
parameters:
properties:
location:
type: string
description: The name of the city to find the weather from.
type: object
- function: summarize_conversation
description: Summarize the conversation.
parameters:
type: object
properties:
name:
type: string
description: The name of the user.