Closed
Description
Checkboxes for prior research
- I've gone through Developer Guide and API referenceI've checked AWS Forums and StackOverflow.I've searched for previous similar issues and didn't find any solution.
Describe the bug
In InvokeInlineAgentCommandInput
, the attribute actionGroups.functionSchema.functions.parameters.my_parameter.required
is typed as optional. However, the command crashes if it is not explicitely set to true or false.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/client-bedrock-agent-runtime@3.721.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.18.1
Reproduction Steps
// This works
await this.bedrockClient.send(new InvokeInlineAgentCommand({
foundationModel: "anthropic.claude-3-5-sonnet-20241022-v2:0",
instruction: "Translate the user input text to Spanish. Only do that, noting more.",
actionGroups: [
{
actionGroupName: "profile-management",
description: "Functions to manage user profiles including loading and saving profile information.",
actionGroupExecutor: {
customControl: "RETURN_CONTROL"
},
functionSchema: {
functions: [
{
name: "save_profile",
description: "Save or update the user's profile",
parameters: {
name: { type: "string", "required": true }, // <-- Required is explicitely set
},
}
]
}
}],
inputText: "Bonjour",
// (Other arguments ommited for clarity...)
}));
// This doesn't work
await this.bedrockClient.send(new InvokeInlineAgentCommand({
foundationModel: "anthropic.claude-3-5-sonnet-20241022-v2:0",
instruction: "Translate the user input text to Spanish. Only do that, noting more.",
actionGroups: [
{
actionGroupName: "profile-management",
description: "Functions to manage user profiles including loading and saving profile information.",
actionGroupExecutor: {
customControl: "RETURN_CONTROL"
},
functionSchema: {
functions: [
{
name: "save_profile",
description: "Save or update the user's profile",
parameters: {
name: { type: "string" }, // <-- Required is not set
},
}
]
}
}],
inputText: "Bonjour",
// (Other arguments ommited for clarity...)
}));
When it does not work, I get this error
ERROR Error: InternalServerException: Internal Server Exception
/Users/maxime/workspace/project/app/node_modules/@aws-sdk/client-bedrock-agent-runtime/dist-cjs/index.js:2706
const exception = new InternalServerException({
^
InternalServerException: Internal Server Exception
at de_InternalServerExceptionRes (/Users/maxime/workspace/project/app/node_modules/@aws-sdk/client-bedrock-agent-runtime/dist-cjs/index.js:2706:21)
at de_CommandError (/Users/maxime/workspace/project/app/node_modules/@aws-sdk/client-bedrock-agent-runtime/dist-cjs/index.js:2619:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/maxime/workspace/project/app/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20
at async /Users/maxime/workspace/project/app/node_modules/@smithy/core/dist-cjs/index.js:168:18
at async /Users/maxime/workspace/project/app/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38
at async /Users/maxime/workspace/project/app/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:34:22
at async BedrockAgent.run (/Users/maxime/workspace/project/app/src/bedrock-agent.ts:381:26)
at async main (/Users/maxime/workspace/project/app/src/debugger.ts:44:30) {
'$fault': 'server',
'$metadata': {
httpStatusCode: 500,
requestId: 'ade3e9b7-xxxx-xxxx-xxxx-33ef997c7b7c',
extendedRequestId: undefined,
cfId: undefined,
attempts: 3,
totalRetryDelay: 95
}
}
Observed Behavior
Not explicitely setting the optional attribute actionGroups.functionSchema.functions.parameters.my_parameter.required
triggers a cryptic Internal Server Error
Expected Behavior
Being able to not set required
OR having it typed as not optional
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
zshzbh commentedon Jan 7, 2025
Hey @maximelebastard ,
I can reproduce this issue -
Code I have
the console log I have -
I will forward this issue to the team.
Thanks for the feedback!
zshzbh commentedon Jan 7, 2025
Root cause - This is the interface of
ParameterDetail
,required
is optional in AWS SDK but is required in the runtime.In service doc - it's also marked as optional. I will contact service team to follow up this issue.
zshzbh commentedon May 7, 2025
Hey @maximelebastard ,
The fix has been deployed, I'm closing this issue. :) Please let me know if you have any other issues. Thanks for the feedback! Hope you have a nice one!
github-actions commentedon May 7, 2025
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
github-actions commentedon May 22, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.