You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -30,6 +31,10 @@ export function generateFindRelevantReleasesPrompt(
30
31
checkResult: string,
31
32
releases: GithubReleaseForPrompt[],
32
33
): [string,PromptConfig]{
34
+
validObject.parse(check);
35
+
validString.parse(checkResult);
36
+
validObjectList.parse(releases);
37
+
33
38
return[
34
39
`Based on the following releases, which ones are most relevant to the check state change?
35
40
@@ -61,6 +66,10 @@ export function generateFindRelevantDeploymentsPrompt(
61
66
checkResult: string,
62
67
deployments: GithubDeploymentForPrompt[],
63
68
): [string,PromptConfig]{
69
+
validObject.parse(check);
70
+
validString.parse(checkResult);
71
+
validObjectList.parse(deployments);
72
+
64
73
return[
65
74
`Based on the following deployments, which ones are most relevant to the check state change? Analyze the check script, result and releases to determine which releases are most relevant. Provide a list of deployment ids that are most relevant to the check.
66
75
@@ -89,6 +98,10 @@ export function generateReleaseHeadlinePrompt(
89
98
currentRelease: string,
90
99
diff: string,
91
100
): [string,PromptConfig]{
101
+
validString.parse(prevRelease);
102
+
validString.parse(currentRelease);
103
+
validString.parse(diff);
104
+
92
105
return[
93
106
`The following diff describes the changes between ${prevRelease} and ${currentRelease}.
94
107
@@ -112,6 +125,10 @@ export function generateReleaseSummaryPrompt(
112
125
currentRelease: string,
113
126
diff: string,
114
127
): [string,PromptConfig]{
128
+
validString.parse(prevRelease);
129
+
validString.parse(currentRelease);
130
+
validString.parse(diff);
131
+
115
132
return[
116
133
`The following diff describes the changes between ${prevRelease} and ${currentRelease}.
117
134
@@ -137,6 +154,10 @@ export function generateDeploymentSummaryPrompt(
137
154
currentSha: string,
138
155
diff: string,
139
156
): [string,PromptConfig]{
157
+
validString.parse(prevSha);
158
+
validString.parse(currentSha);
159
+
validString.parse(diff);
160
+
140
161
return[
141
162
`The following diff describes the changes between ${prevSha} and ${currentSha}.
142
163
@@ -159,6 +180,9 @@ export function generateFindRepoPrompt(
159
180
userPrompt: string,
160
181
allRepos: GithubRepoForPrompt[],
161
182
): [string,PromptConfig]{
183
+
validString.parse(userPrompt);
184
+
validObjectList.parse(allRepos);
185
+
162
186
return[
163
187
`Based on the following prompt: ${userPrompt} and the list of repositories
exportconstslackFormatInstructions=`Format all output in Slack mrkdwn format.
6
7
Generate Slack messages using the following style: *bold*, <link|text>, _italics_, > quote, \`code\`, \`\`\`code block\`\`\`.
@@ -31,6 +32,9 @@ export function channelSummaryPrompt(
31
32
alert: WebhookAlertDto,
32
33
messageHistory: SlackMsgForPrompt[],
33
34
): [string,PromptConfig]{
35
+
validObject.parse(alert);
36
+
validObjectList.parse(messageHistory);
37
+
34
38
return[
35
39
`You are a Slack channel context collector. Your task is to analyze the given message history based on a specific prompt and provide a concise summary of the relevant context.
Copy file name to clipboardexpand all lines: src/prompts/sre-assistant.ts
+5
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,15 @@
1
1
import{slackFormatInstructions}from"./slack";
2
+
import{validString}from"./validation";
2
3
3
4
exportfunctiongenerateSREAssistantPrompt(
4
5
username: string,
5
6
date: string,
6
7
alertSummary: string,
7
8
): string{
9
+
validString.parse(username);
10
+
validString.parse(date);
11
+
validString.parse(alertSummary);
12
+
8
13
return`You are an AI-powered SRE Bot designed to assist in real-time incident management. Your primary goal is to reduce Mean Time To Resolution (MTTR) by automatically aggregating and analyzing contextual data, providing actionable insights, and guiding first responders effectively.
0 commit comments