Skip to content

Commit

Permalink
fix: enforce all cloudproviders to have prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidabbm committed Nov 16, 2023
1 parent d2ca111 commit e66fe76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/utils/prompts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ import {
AWS_GENERATE_POLICIES_PROMPT,
} from './aws';

// Make prompts immutable, cannog assign prompts.aws = {} will error
type Prompts = {
[k in CloudProviders]: {
readonly [k in CloudProviders]: {
DETECT_STATEMENTS_PROMPT: ChatPromptTemplate;
GENERATE_POLICIES_PROMPT: ChatPromptTemplate;
};
};

export default {
// Enforce all cloudproviders to have prompts
const cpPrompts: Prompts = {
aws: {
DETECT_STATEMENTS_PROMPT: AWS_DETECT_STATEMENTS_PROMPT,
GENERATE_POLICIES_PROMPT: AWS_GENERATE_POLICIES_PROMPT,
},
} as Prompts;
};

export default cpPrompts;

0 comments on commit e66fe76

Please sign in to comment.