Closed pd2871 closed 3 days ago
Thanks for reaching out. If a parameter is optional and you do not want to use it, then you should just not include it in your command. Otherwise it is expected that the command would fail with a ParamValidationError
here, because you are passing a None
type. When I try that I get the error:
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter wordPolicyConfig, value: None, type: <class 'NoneType'>, valid types: <class 'dict'>
What you're actually doing is probably:
'wordPolicyConfig':{
'wordsConfig': [
{
'text': ''
},
],
},
I get the error you referenced when attempting to use that configuration. The API is expecting a value for text
here.
Also the Boto3 create_guardail command involves a call to the underlying Amazon Bedrock CreateGuardrail API. Therefore the Boto3 team here cannot modify the underlying behavior here. If you'd like someone to reach out to the Bedrock team on your behalf, please create an issue in our cross-SDK repository (https://github.com/aws/aws-sdk/issues) outlining your request.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the bug
According to AWS documentation, some of the fields are not required compulsorily in client.create_guardrail wordPolicyConfig topicPolicyConfig ... ...
So, the main problem I am facing is when creating a guardrail using boto3, these fields are needed compulsorily.
I do not want LLM to restrict on any specific word after creating guardrails using boto3 but boto3 keeps on throwing error to add atleast 1 word?
So, I hope boto3 team makes these fields
Optional
instead ofCOMPULSORY
.Expected Behavior
I expected that if I pass
wordPolicyConfig=None
while usingclient.create_guardrail
, it should work fine.It is expected to not throw any error
Current Behavior
If
wordPolicyConfig=None
is passed withclient.create_guardrail
, it throws error.Reproduction Steps
Some of those fields should be made Optional instead of Compulsory based on AWS Guardrails API documentation.
Possible Solution
Some of those fields should be made Optional instead of Compulsory based on AWS Guardrails API documentation.
Additional Information/Context
No response
SDK version used
1.34.105
Environment details (OS name and version, etc.)
Windows 10