File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed
Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 11import { Construct } from "constructs"
22import { BedrockPrompt } from "../constructs/BedrockPrompt"
33
4+ export interface BedrockPromptsProps {
5+ readonly stackName : string
6+ }
7+
48export class BedrockPrompts extends Construct {
59 public readonly queryReformulationPrompt : BedrockPrompt
610
7- constructor ( scope : Construct , id : string ) {
11+ constructor ( scope : Construct , id : string , props : BedrockPromptsProps ) {
812 super ( scope , id )
913
1014 this . queryReformulationPrompt = new BedrockPrompt ( this , "QueryReformulationPrompt" , {
11- promptName : "query-reformulation" ,
12- promptText : "PLACEHOLDER - Update this prompt text via AWS Console " ,
13- description : "Prompt for reformulating user queries to improve RAG retrieval - UPDATE VIA CONSOLE "
15+ promptName : ` ${ props . stackName } -queryReformulation` ,
16+ promptText : "PLACEHOLDER" ,
17+ description : "Prompt for reformulating user queries to improve RAG retrieval"
1418 } )
1519 }
1620}
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export interface FunctionsProps {
3333 readonly slackBotTokenSecret : Secret
3434 readonly slackBotSigningSecret : Secret
3535 readonly slackBotStateTable : TableV2
36+ readonly promptName : string
3637}
3738
3839export class Functions extends Construct {
@@ -73,7 +74,7 @@ export class Functions extends Construct {
7374 "GUARD_RAIL_ID" : props . guardrailId ,
7475 "GUARD_RAIL_VERSION" : props . guardrailVersion ,
7576 "SLACK_BOT_STATE_TABLE" : props . slackBotStateTable . tableName ,
76- "QUERY_REFORMULATION_PROMPT_NAME" : "query-reformulation"
77+ "QUERY_REFORMULATION_PROMPT_NAME" : props . promptName
7778 }
7879 } )
7980
Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ export class EpsAssistMeStack extends Stack {
5757 } )
5858
5959 // Create Bedrock Prompts
60- const bedrockPrompts = new BedrockPrompts ( this , "BedrockPrompts" )
60+ const bedrockPrompts = new BedrockPrompts ( this , "BedrockPrompts" , {
61+ stackName : props . stackName
62+ } )
6163
6264 // Create Storage construct first as it has no dependencies
6365 const storage = new Storage ( this , "Storage" , {
@@ -126,7 +128,8 @@ export class EpsAssistMeStack extends Stack {
126128 account,
127129 slackBotTokenSecret : secrets . slackBotTokenSecret ,
128130 slackBotSigningSecret : secrets . slackBotSigningSecret ,
129- slackBotStateTable : tables . slackBotStateTable . table
131+ slackBotStateTable : tables . slackBotStateTable . table ,
132+ promptName : bedrockPrompts . queryReformulationPrompt . promptName
130133 } )
131134
132135 // Create vector index after Functions are created
You can’t perform that action at this time.
0 commit comments