Thanks for Powertools — it's our default for Lambda.
Use case
A Bedrock Agent action group that returns non-ASCII text (e.g. Korean 잔액은 1,000원입니다 or emoji) is \uXXXX-escaped in responseBody.body, because BedrockResponseBuilder.build() (event_handler/bedrock_agent.py:42) serializes via the default json.dumps(..., ensure_ascii=True) serializer (api_gateway.py:1625).
Unlike ApiGatewayResolver and the sibling BedrockAgentFunctionResolver — both of which expose a serializer= argument (as noted by the maintainer in #7776) — BedrockAgentResolver.__init__ hardcodes serializer=None (bedrock_agent.py:102-111) with no way to override it. So there's no supported way to emit readable non-ASCII from a Bedrock Agent resolver.
Solution/User Experience
Expose the parent's existing serializer parameter on BedrockAgentResolver (no new abstraction — the same serializer param #6394 endorsed and the sibling function resolver already accepts). Users could then pass partial(json.dumps, ensure_ascii=False).
Alternative solutions
Defaulting the builder to ensure_ascii=False would be a behavior change; exposing the existing param is additive and lower-risk.
I'd be happy to open a small PR with a regression test.
This issue was prepared with the help of an AI agent (Claude Code) and reviewed by a human.
Thanks for Powertools — it's our default for Lambda.
Use case
A Bedrock Agent action group that returns non-ASCII text (e.g. Korean
잔액은 1,000원입니다or emoji) is\uXXXX-escaped inresponseBody.body, becauseBedrockResponseBuilder.build()(event_handler/bedrock_agent.py:42) serializes via the defaultjson.dumps(..., ensure_ascii=True)serializer (api_gateway.py:1625).Unlike
ApiGatewayResolverand the siblingBedrockAgentFunctionResolver— both of which expose aserializer=argument (as noted by the maintainer in #7776) —BedrockAgentResolver.__init__hardcodesserializer=None(bedrock_agent.py:102-111) with no way to override it. So there's no supported way to emit readable non-ASCII from a Bedrock Agent resolver.Solution/User Experience
Expose the parent's existing
serializerparameter onBedrockAgentResolver(no new abstraction — the sameserializerparam #6394 endorsed and the sibling function resolver already accepts). Users could then passpartial(json.dumps, ensure_ascii=False).Alternative solutions
Defaulting the builder to
ensure_ascii=Falsewould be a behavior change; exposing the existing param is additive and lower-risk.I'd be happy to open a small PR with a regression test.
This issue was prepared with the help of an AI agent (Claude Code) and reviewed by a human.