diff --git a/.changeset/happy-starfishes-trade.md b/.changeset/happy-starfishes-trade.md new file mode 100644 index 0000000000..48ceaecfa5 --- /dev/null +++ b/.changeset/happy-starfishes-trade.md @@ -0,0 +1,5 @@ +--- +'@aws-amplify/ai-constructs': patch +--- + +Do not bundle AWS SDK if default implementation is used diff --git a/packages/ai-constructs/src/conversation/conversation_handler_construct.ts b/packages/ai-constructs/src/conversation/conversation_handler_construct.ts index 4f74591170..57b33f779f 100644 --- a/packages/ai-constructs/src/conversation/conversation_handler_construct.ts +++ b/packages/ai-constructs/src/conversation/conversation_handler_construct.ts @@ -62,7 +62,10 @@ export class ConversationHandlerFunction entry: this.props.entry ?? defaultHandlerFilePath, handler: 'handler', bundling: { - bundleAwsSDK: true, + // Do not bundle SDK if conversation handler is using our default implementation which is + // compatible with Lambda provided SDK. + // For custom entry we do bundle SDK as we can't control version customer is coding against. + bundleAwsSDK: !!this.props.entry, }, logGroup: new LogGroup(this, 'conversationHandlerFunctionLogGroup', { retention: RetentionDays.INFINITE,