Skip to content

Commit 9807c2c

Browse files
committed
fix createEvent function to not add parameters key and set to undefined
1 parent 3b560ed commit 9807c2c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

packages/event-handler/src/bedrock-agent/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function assertBedrockAgentFunctionEvent(
1717
'function' in event &&
1818
isString(event.function) &&
1919
(!('parameters' in event) ||
20-
event.parameters == null ||
2120
(Array.isArray(event.parameters) &&
2221
event.parameters.every(
2322
(param) =>

packages/event-handler/tests/unit/bedrock-agent/BedrockAgentFunctionResolver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function createEvent(functionName: string, parameters?: Parameter[]) {
2222
sessionId: 'sessionId',
2323
inputText: 'inputText',
2424
function: functionName,
25-
parameters,
25+
...(parameters == null ? {} : { parameters }),
2626
actionGroup: 'myActionGroup',
2727
sessionAttributes: {},
2828
promptSessionAttributes: {},

0 commit comments

Comments
 (0)