forked from aws-samples/aws-genai-llm-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws-genai-llm-chatbot.ts
39 lines (32 loc) · 1.23 KB
/
aws-genai-llm-chatbot.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import { ChatBotStack } from '../lib/chatbot-stack';
import { ChatBotUIStack } from '../lib/chatbot-ui-stack';
import { ChatBotVpcStack } from '../lib/chatbot-vpc-stack';
import { SemanticSearchStack } from '../lib/semantic-search/semantic-search-stack';
const config = {
deployUI: true,
deploySemanticSearch: false,
prefix: 'GenAI',
maxParallelLLMQueries: 10,
};
const app = new cdk.App();
const chatBotVpcStack = new ChatBotVpcStack(app, `${config.prefix}-ChatBotVpcStack`);
let semanticSearchApi: lambda.Function | null = null;
if (config.deploySemanticSearch) {
const semanticSearch = new SemanticSearchStack(app, `${config.prefix}-SemanticSearchStack`, {
vpc: chatBotVpcStack.vpc,
});
semanticSearchApi = semanticSearch.semanticSearchApi;
}
const chatBotStack = new ChatBotStack(app, `${config.prefix}-ChatBotStack`, {
vpc: chatBotVpcStack.vpc,
semanticSearchApi,
maxParallelLLMQueries: config.maxParallelLLMQueries,
});
if (config.deployUI) {
const chatBotUIStack = new ChatBotUIStack(app, `${config.prefix}-ChatBotUIStack`);
chatBotUIStack.addDependency(chatBotStack);
}