From 9535f95bb155c2f43813b2fb0f17d8d3e126f091 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Fri, 6 Sep 2024 10:41:21 -0700 Subject: [PATCH] Do not bundle AWS SDK if default implementation is used. --- .../src/conversation/conversation_handler_construct.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,