Skip to content

Commit ef31cb5

Browse files
Small refactor + documentation
1 parent 20215ed commit ef31cb5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/events/bedrockAgentFunctionEvent.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
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+
}

tests/functional/event_handler/required_dependencies/test_bedrock_agent_functions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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"]

0 commit comments

Comments
 (0)