Configure the deployment details of the LLM model and publish the process.
1Open the Prompt Chaining Amazon Bedrock process.
2On the Temp Fields tab of the Start step, in the Model_id field, enter the deployment ID of the LLM model that was deployed.
The default model id is anthropic.claude-3-sonnet-20240229-v1:0. You can optionally edit the model id.
3Optionally, in the Configure Request Parameters step, configure the prompt instructions in the Assignments field by updating the Prompt_Configuration field using the Expression Editor, as shown in the following sample code:
For the Prompt_Configuration field, enter values for the following properties:
Property
Description
max_tokens
Defines the maximum number of tokens that the model can generate in its response. Setting a limit ensures that the response is concise and fits within the desired length constraints.
temperature
Controls the randomness of the model's output. A lower value makes the output more deterministic, while a higher value increases randomness and creativity. For example, a temperature of 0.5 balances between deterministic and creative outputs.
topP
Determines the cumulative probability threshold for token selection. The model considers the smallest set of tokens whose cumulative probability meets or exceeds topP. For example, if topP is set to 0.1, the model considers only the top 10% most probable tokens at each step.
4In the Create Prompt step, enter the prompt instructions in the Assignments field by updating the Prompt_Request field using the Expression Editor as shown in the following sample code:
<root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data"> <system m:isArray="true"> <type>text</type> <text>You are an {$input.System_Behaviour } assistant and your goal is to provide responses to queries while avoiding potential harm.</text> </system> <messages m:isArray="true"> <role>user</role> <content m:isArray="true"> <type>text</type> <text>{$input.First_User_Prompt }</text> </content> </messages> <interfenceConfig> <max_tokens m:type="xs:int">{$temp.Prompt_Configuration[1]/MaxTokens }</max_tokens> <temperature m:type="xs:double">{$temp.Prompt_Configuration[1]/Temperature }</temperature> <topP m:type="xs:double">{$temp.Prompt_Configuration[1]/TopP }</topP> </interfenceConfig> </root>
After configuring the prompt instructions, the process sends the details to the LLM to fetch the required response, and then stores the first response.
5In the Create Second Prompt step, in the Assignments field, update the Prompt_Request field using the Expression Editor as shown in the following sample code:
<root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data"> <system m:isArray="true"> <type>text</type> <text>You are an {$input.System_Behaviour } assistant and your goal is to provide responses to queries while avoiding potential harm.</text> </system> <messages m:isArray="true"> <role>user</role> <content m:isArray="true"> <type>text</type> <text>{$input.First_User_Prompt }</text> </content> </messages> <messages m:isArray="true"> <role>assistant</role> <content m:isArray="true"> <type>text</type> <text>{$output.LLM_Answer}</text> </content> </messages> <messages m:isArray="true"> <role>user</role> <content m:isArray="true"> <type>text</type> <text>{$input.Second_User_Prompt }</text> </content> </messages> <interfenceConfig> <max_tokens m:type="xs:int">{$temp.Prompt_Configuration[1]/MaxTokens }</max_tokens> <temperature m:type="xs:double">{$temp.Prompt_Configuration[1]/Temperature }</temperature> <topP m:type="xs:double">{$temp.Prompt_Configuration[1]/TopP }</topP> </interfenceConfig> </root>
The LLM uses both the requests as an instruction to prepare the final response.