Skip to content

Commit 6833182

Browse files
committed
Rename class from BedrockPrompts to BedrockPromptResources
1 parent e838f65 commit 6833182

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/cdk/constructs/BedrockPrompt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {CfnPrompt} from "aws-cdk-lib/aws-bedrock"
44
export interface BedrockPromptProps {
55
promptName: string
66
promptText: string
7-
description?: string
7+
description: string
88
}
99

1010
export class BedrockPrompt extends Construct {
@@ -16,7 +16,7 @@ export class BedrockPrompt extends Construct {
1616

1717
const prompt = new CfnPrompt(this, "Prompt", {
1818
name: props.promptName,
19-
description: props.description || `Prompt for ${props.promptName}`,
19+
description: props.description,
2020
variants: [
2121
{
2222
name: "default",

packages/cdk/resources/BedrockPrompts.ts renamed to packages/cdk/resources/BedrockPromptResources.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {Construct} from "constructs"
22
import {BedrockPrompt} from "../constructs/BedrockPrompt"
33

4-
export interface BedrockPromptsProps {
4+
export interface BedrockPromptResourcesProps {
55
readonly stackName: string
66
}
77

8-
export class BedrockPrompts extends Construct {
8+
export class BedrockPromptResources extends Construct {
99
public readonly queryReformulationPrompt: BedrockPrompt
1010

11-
constructor(scope: Construct, id: string, props: BedrockPromptsProps) {
11+
constructor(scope: Construct, id: string, props: BedrockPromptResourcesProps) {
1212
super(scope, id)
1313

1414
this.queryReformulationPrompt = new BedrockPrompt(this, "QueryReformulationPrompt", {

packages/cdk/stacks/EpsAssistMeStack.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {BedrockExecutionRole} from "../resources/BedrockExecutionRole"
1515
import {RuntimePolicies} from "../resources/RuntimePolicies"
1616
import {VectorIndex} from "../resources/VectorIndex"
1717
import {DatabaseTables} from "../resources/DatabaseTables"
18-
import {BedrockPrompts} from "../resources/BedrockPrompts"
18+
import {BedrockPromptResources} from "../resources/BedrockPromptResources"
1919
import {S3LambdaNotification} from "../constructs/S3LambdaNotification"
2020

2121
const VECTOR_INDEX_NAME = "eps-assist-os-index"
@@ -56,8 +56,8 @@ export class EpsAssistMeStack extends Stack {
5656
stackName: props.stackName
5757
})
5858

59-
// Create Bedrock Prompts
60-
const bedrockPrompts = new BedrockPrompts(this, "BedrockPrompts", {
59+
// Create Bedrock Prompt Resources
60+
const bedrockPromptResources = new BedrockPromptResources(this, "BedrockPromptResources", {
6161
stackName: props.stackName
6262
})
6363

@@ -105,7 +105,7 @@ export class EpsAssistMeStack extends Stack {
105105
knowledgeBaseArn: vectorKB.knowledgeBase.attrKnowledgeBaseArn,
106106
guardrailArn: vectorKB.guardrail.attrGuardrailArn,
107107
dataSourceArn: vectorKB.dataSourceArn,
108-
promptName: bedrockPrompts.queryReformulationPrompt.promptName
108+
promptName: bedrockPromptResources.queryReformulationPrompt.promptName
109109
})
110110

111111
// Create Functions construct with actual values from VectorKB
@@ -130,7 +130,7 @@ export class EpsAssistMeStack extends Stack {
130130
slackBotTokenSecret: secrets.slackBotTokenSecret,
131131
slackBotSigningSecret: secrets.slackBotSigningSecret,
132132
slackBotStateTable: tables.slackBotStateTable.table,
133-
promptName: bedrockPrompts.queryReformulationPrompt.promptName
133+
promptName: bedrockPromptResources.queryReformulationPrompt.promptName
134134
})
135135

136136
// Create vector index after Functions are created
@@ -168,7 +168,7 @@ export class EpsAssistMeStack extends Stack {
168168

169169
// Output: Bedrock Prompt ARN
170170
new CfnOutput(this, "QueryReformulationPromptArn", {
171-
value: bedrockPrompts.queryReformulationPrompt.promptArn,
171+
value: bedrockPromptResources.queryReformulationPrompt.promptArn,
172172
description: "ARN of the query reformulation prompt in Bedrock"
173173
})
174174

0 commit comments

Comments
 (0)