File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
functional/event_handler/required_dependencies Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1919 "function" : " submitVacationRequest" ,
2020 "parameters" : [
2121 {
22- "name" : " startDate " ,
22+ "name" : " start_date " ,
2323 "type" : " string" ,
2424 "value" : " 2024-03-15"
2525 },
2626 {
27- "name" : " endDate " ,
27+ "name" : " end_date " ,
2828 "type" : " string" ,
2929 "value" : " 2024-03-20"
3030 }
3131 ]
32- }
32+ }
Original file line number Diff line number Diff line change @@ -218,20 +218,20 @@ def test_bedrock_agent_function_with_parameters():
218218 received_params = {}
219219
220220 @app .tool (description = "Function that accepts parameters" )
221- def vacation_request (startDate , endDate ):
221+ def vacation_request (start_date , end_date ):
222222 # Store received parameters for assertion
223- received_params ["startDate " ] = startDate
224- received_params ["endDate " ] = endDate
225- return f"Vacation request from { startDate } to { endDate } submitted"
223+ received_params ["start_date " ] = start_date
224+ received_params ["end_date " ] = end_date
225+ return f"Vacation request from { start_date } to { end_date } submitted"
226226
227227 # WHEN calling the event handler with parameters
228228 raw_event = load_event ("bedrockAgentFunctionEvent.json" )
229229 raw_event ["function" ] = "vacation_request"
230230 result = app .resolve (raw_event , {})
231231
232232 # THEN parameters should be correctly passed to the function
233- assert received_params ["startDate " ] == "2024-03-15"
234- assert received_params ["endDate " ] == "2024-03-20"
233+ assert received_params ["start_date " ] == "2024-03-15"
234+ assert received_params ["end_date " ] == "2024-03-20"
235235 assert (
236236 "Vacation request from 2024-03-15 to 2024-03-20 submitted"
237237 in result ["response" ]["functionResponse" ]["responseBody" ]["TEXT" ]["body" ]
You can’t perform that action at this time.
0 commit comments