You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to chat with my model via ConverseCommand without issues. I recently created a guardrail on the AWS Console, and I was able to achieve the desired results.
When I attempted to integrate the guardrail using guardrailConfig on ConverseCommandInput and adding the guardContent property to the latest message (I am trying to run the guardrail on the last user message) I get a ValidationException: Guardrail was enabled but input is in incorrect format., even though the format in the message below matches the example.
I hope it's a simple fix on my end and I've messed up the format somehow.
Here is a simplified code snippet that results in the error I'm seeing:
In case anyone else comes across this again - ValidationException: Guardrail was enabled but input is in incorrect format.
I was able to figure out through trial and error that the guardrails must be located in the same region as the foundational model being used. Once I switched to a model in us-east-1, my request worked. That being said, this was not explicitly mentioned in any resources I consulted.
Would love for the resulting error message to be a bit more descriptive - e.g. "ValidationException: Guardrail region must match model region" or something to that effect, assuming of course that is the behavior.
Hi @rd37011 - thanks for reaching out and sharing the feedback.
I've confirmed with service team Bedrock that this's expected behavior to have same region for both model and guardrails. Since the error comes from service team rather than SDK, I've forwarded this feedback to the team.
Please feel free to reach out again. Closing the issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Describe the issue
I am able to chat with my model via ConverseCommand without issues. I recently created a guardrail on the AWS Console, and I was able to achieve the desired results.
When I attempted to integrate the guardrail using
guardrailConfig
onConverseCommandInput
and adding theguardContent
property to the latest message (I am trying to run the guardrail on the last user message) I get aValidationException: Guardrail was enabled but input is in incorrect format.
, even though the format in the message below matches the example.I hope it's a simple fix on my end and I've messed up the format somehow.
Here is a simplified code snippet that results in the error I'm seeing:
Links
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/ConverseCommand/
https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-use-converse-api.html#guardrails-use-converse-api-call-configure
The text was updated successfully, but these errors were encountered: