bedrock-runtime
client apply_guardrail
function adds new line at the end of masked text
#4317
Labels
bedrock-runtime
bug
This issue is a confirmed bug.
p2
This is a standard priority issue
service-api
This issue is caused by the service API, not the SDK implementation.
Describe the bug
When using bedrock-runtime
apply_guardrail
on a given text, where guardrail is configured withmask
action, the returned text is indeed masked where needed, but a new line is added to the given input.Regression Issue
Expected Behavior
Bedrock should return the text as is, while masking the configured addresses without a newline at the end.
guard_res['outputs'][0]['text']
should be:Current Behavior
Actual results (
guard_res['outputs'][0]['text']
):As you can see when scrolling to the end of the resulting text, a newline character
\n
was added to the end of the text.Reproduction Steps
Possible Solution
I'm unsure of the root cause of this behavior, but I see that the client already got the new line char as a response to the API call.
Additional Information/Context
I also checked the usage of
configuredGuardrail
in the call for theconverse
function. The behavior didn't reproduce, and the guarded text returned as expected.SDK version used
1.34.162
Environment details (OS name and version, etc.)
MacOS 14.7
The text was updated successfully, but these errors were encountered: