- Newest
- Most votes
- Most comments
When using a Lex node in an Amazon Bedrock flow, you can configure the "requestAttributes" and "sessionAttributes" as inputs to the node. Here's how you can set these up in the Flow Builder:
-
In the Lex node configuration, you'll need to specify the Amazon Resource Name (ARN) of the alias of the bot you want to use, as well as the locale.
-
For the inputs, you'll see three main options:
- inputText: This is where you'll provide the utterance or user input to be processed by the Lex bot.
- requestAttributes: This is an object type input where you can pass request-specific attributes.
- sessionAttributes: This is also an object type input for session-specific attributes.
To set up these inputs via drag and drop in the Flow Builder:
-
Create input nodes or use outputs from previous nodes that will provide the necessary data for requestAttributes and sessionAttributes.
-
Connect these nodes to the Lex node's corresponding input circles (on the left side of the node).
-
In the Lex node configuration, you'll need to use expressions to map these inputs correctly. For example:
- For requestAttributes, you might use an expression like:
${previousNode.requestAttributesOutput} - For sessionAttributes, you could use:
${anotherNode.sessionAttributesOutput}
- For requestAttributes, you might use an expression like:
Remember that both requestAttributes and sessionAttributes are of type "Object", so ensure that the data you're passing matches this type.
The Lex node will process the input using your configured Lex bot and return the identified intent as the output, which you can then use in subsequent nodes in your flow.
Keep in mind that while you can use the Lex node to interact with your chatbot within the flow, the flow itself doesn't support multi-turn interactions. If your Lex bot requires multiple turns to complete a conversation, you'll need to handle that outside of a single flow execution, possibly by chaining multiple flows or managing the conversation state at the application level.
Sources
Node types in flow - Amazon Bedrock
LexFlowNodeConfiguration - Amazon Bedrock
FlowNodeConfiguration - Amazon Bedrock
The question is: How do I pass these two variables? Since it is a flow from one node to another, from which node I can pass the request and Session attribute
****In the Lex node configuration, you'll need to use expressions to map these inputs correctly. For example:
For requestAttributes, you might use an expression like: ${previousNode.requestAttributesOutput} For sessionAttributes, you could use: ${anotherNode.sessionAttributesOutput}****
In the below pictures, I can pass on the input but the remaining 2 attributes are the question.
Thanks in advance
answered 2 years ago
Relevant content
asked 2 years ago
asked 2 years ago
asked 2 years ago
