File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
tests/functional/event_handler/required_dependencies Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ def decimal_serializer(obj):
441
441
@app .tool ()
442
442
def decimal_response ():
443
443
# Return a response with Decimal type that standard JSON can't serialize
444
- return {"price" : decimal .Decimal ("99.99" )}
444
+ return {"price" : round ( decimal .Decimal ("99" ) )}
445
445
446
446
# WHEN calling with a response containing non-standard JSON types
447
447
raw_event = load_event ("bedrockAgentFunctionEvent.json" )
@@ -450,7 +450,6 @@ def decimal_response():
450
450
451
451
# THEN non-standard types should be properly serialized
452
452
response_body = result ["response" ]["functionResponse" ]["responseBody" ]["TEXT" ]["body" ]
453
- parsed_response = json .loads (response_body )
454
453
455
454
# VERIFY that decimal was converted to float and datetime to ISO string
456
- assert parsed_response [ "price" ] == 99.99
455
+ assert response_body == json . dumps ({ "price" : 99 })
You can’t perform that action at this time.
0 commit comments