-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid logic for promptOverrideConfigurations (bedrock.AgentAgentPromptOverrideConfiguration) #5300
Comments
promptOverrideConfigurations: [
{
overrideLambda: null,
promptConfigurations: [
{
parserMode: 'DEFAULT',
promptType: 'POST_PROCESSING',
promptCreationMode: 'OVERRIDDEN',
promptState: 'ENABLED',
basePromptTemplate:
'{\n' +
' "anthropic_version": "bedrock-2023-05-31",\n' +
' "system": "",\n' +
' "messages": [\n' +
' {\n' +
' "role" : "user",\n' +
' "content" : [{\n' +
' "type": "text",\n' +
' "text": "\n' +
" Oui Oui, You are an agent tasked with providing more context to an answer that a function calling agent outputs. The function calling agent takes in a user's question and calls the appropriate functions (a function call is equivalent to an API call) that it has been provided with in order to take actions in the real-world and gather more information to help answer the user's question.\n" +
" At times, the function calling agent produces responses that may seem confusing to the user because the user lacks context of the actions the function calling agent has taken. Here's an example:\n" +
' <example>\n' +
" The user tells the function calling agent: 'Acknowledge all policy engine violations under me. My alias is jsmith, start date is 09/09/2023 and end date is 10/10/2023.'\n" +
" After calling a few API's and gathering information, the function calling agent responds, 'What is the expected date of resolution for policy violation POL-001?'\n" +
" This is problematic because the user did not see that the function calling agent called API's due to it being hidden in the UI of our application. Thus, we need to provide the user with more context in this response. This is where you augment the response and provide more information.\n" +
" Here's an example of how you would transform the function calling agent response into our ideal response to the user. This is the ideal final response that is produced from this specific scenario: 'Based on the provided data, there are 2 policy violations that need to be acknowledged - POL-001 with high risk level created on 2023-06-01, and POL-002 with medium risk level created on 2023-06-02. What is the expected date of resolution date to acknowledge the policy violation POL-001?'\n" +
' </example>\n' +
" It's important to note that the ideal answer does not expose any underlying implementation details that we are trying to conceal from the user like the actual names of the functions.\n" +
" Do not ever include any API or function names or references to these names in any form within the final response you create. An example of a violation of this policy would look like this: 'To update the order, I called the order management APIs to change the shoe color to black and the shoe size to 10.' The final response in this example should instead look like this: 'I checked our order management system and changed the shoe color to black and the shoe size to 10.'\n" +
" Now you will try creating a final response. Here's the original user input <user_input>$question$</user_input>.\n" +
' Here is the latest raw response from the function calling agent that you should transform: <latest_response>$latest_response$</latest_response>.\n' +
' And here is the history of the actions the function calling agent has taken so far in this conversation: <history>$responses$</history>.\n' +
' Please output your transformed response within <final_response></final_response> XML tags.\n' +
' "\n' +
' }]\n' +
' }\n' +
' ]\n' +
'}',
inferenceConfigurations: [
{
temperature: 0,
topP: 1,
topK: 250,
maxLength: 512,
stopSequences: ['\n\nHuman:'],
},
],
},
],
},
], Providing null allowed me to deploy, and it seems working fine. I feel like we should update the documentation, or update the behavior to not make What do you guys think? |
Hi there @jeremycare and thanks a lot for filing the issue! It must be a bug in how we parsed the Terraform schema from which we define the Pulumi schema. Glad to hear you have found a workaround 🙏 I mark it as a bug and we will get to it as soon as possible |
Describe what happened
Current
Field overrideLambda in AgentAgentPromptOverrideConfiguration seems not to be required. But required in Pulumi.
In the AWS documentation we see as following:
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html#API_agent_PromptOverrideConfiguration_Contents
overrideLambda
The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Amazon Bedrock Agents.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 2048.
Pattern: ^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-.]+(:($LATEST|[a-zA-Z0-9-]+))?$
Required: No
Pulumi today forces me to override the parser lambda, but I don't want to, I just want to override one of the prompt configurations (here for example POST_PROCESSING).
Am I missing something? Or the pulumi implementation is restricting it for any particular reason?
Do there is a workaround somewhere for this?
Sample program
Log output
No response
Affected Resource(s)
No response
Output of
pulumi about
N/A
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: