Closed mpoferl closed 2 months ago
Hi @mpoferl ,
You mentioned you are using @aws-sdk/client-bedrock-agent-runtime@3.554.0
but also running your code from lambda.
Are you providing your own SDK to lambda? Or using the Lambda provided SDK?
Im asking because Lambda does not provide the latest version of the SDK. Lambda updates their SDK version roughly twice a year. Since Bedrock added the enableTrace
feature a few months ago, my first instinct is that your Lambda is not using the most up to date version containing this feature.
You can check which SDK version your Lambda provides by doing the following.
Thanks, Ran~
Hey @RanVaknin,
I followed your advice and the log points out the version to 3.515.0.
Could it be related to CodeCatalyst? I created my repo with a blueprint. In the logs are some warnings related to the node version:
CDK CLI version parameter found. Installed CDK CLI v2.137.0 Node dependencies file exists: ./package.json npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@datastream/core@0.0.35', npm WARN EBADENGINE required: { node: '>=18' }, npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@middy/core@5.3.2', npm WARN EBADENGINE required: { node: '>=18' }, npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'aws-sdk-mock@5.9.0', npm WARN EBADENGINE required: { node: '>=18.0.0' }, npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' } npm WARN EBADENGINE }
workflow.yml `Name: onPushToMainDeploymentWorkflow SchemaVersion: "1.0" Triggers:
Hi @mpoferl ,
I'm not sure how you are creating your lambda function. I'm not too familiar with CodeCatalyst. Whichever way you create your lambda function, you need to ensure you provide your own SDK version by bundling and uploading to lambda.
Regarding the warning, I'm not entirely sure why you are seeing this. This is likely unrelated but this warning might be showing because Node 16 is officially deprecated, and Lambda will also be deprecating that runtime starting June of 2024. I suggest that when you create your Lambda, you choose Node 20.
Let me know if this helps. Thanks Ran~
I create the lambda function in the cdk:
const bedrockAgentHandler = new nodejsfunction.NodejsFunction(this, 'BedrockAgentFunction', { runtime: Runtime.NODEJS_18_X, entry: path.join(__dirname, '../lambda/bedrock-agent-handler.handler.ts'), handler: 'lambdaHandler', memorySize: 256, timeout: Duration.seconds(90) });
Okay, it had nothing to do with my lambda or cdk. I deleted my previous agent alias and created a new one and now it is working.
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.
Checkboxes for prior research
Describe the bug
I'm using @aws-sdk/client-bedrock-agent-runtime in my lambda function to send prompts to my bedrock agent. For my use case, I need to set enableTrace: true because I have a knowledge base connected. Unfortunately, I don't get a response from my agent after doing this.
For example, in the knowledge base I have a document which contains "Mona was at the zoo in 2005.". When I ask the agent in the AWS console, it returns "Mona was in the zoo in 2005.". But when I invoke my lambda I receive "Sorry, I don't have enough information to answer that."
SDK version number
@aws-sdk/client-bedrock-agent-runtime@3.554.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
20
Reproduction Steps
Observed Behavior
Expected Behavior
Possible Solution
No response
Additional Information/Context
No response