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.
Name | Type | Default | Description |
---|---|---|---|
amazon_bedrock Required | object | - | An object that contains the Amazon Bedrock parameters . |
Amazon Bedrock parameters​
Name | Type | Default | Description |
---|---|---|---|
global_data Optional | object | - | 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. |
params Optional | object | - | A JSON object containing parameters as key-value pairs. |
post_prompt Optional | object | - | The final set of instructions and configuration settings to send to the agent. |
post_prompt_url Optional | string | - | 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 . |
prompt Required | object | - | Establishes the initial set of instructions and settings to configure the agent. |
SWAIG Optional | object | - | An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue. |
Amazon Bedrock example​
- YAML
- JSON
---
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.
{
"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.\nAt the start of the conversation, always ask the user for their name.\nYou can use the appropriate function to get the phone number, address,\nor weather information.\n"
},
"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."
}
}
}
}
]
}
}
}
]
}
}