Skip to content

Commit 7b4b0bb

Browse files
Doomguy says fix
1 parent 5182632 commit 7b4b0bb

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/llm/LocalLLM.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ export default function LocalLLM() {
304304
// If Doomguy is enabled, append instruction for Doomguy to say something
305305
if (clientSettings.doomguyEnabled) {
306306
systemPrompt += '\n\nWe have a character "Doomguy" who is an avatar for our AI. At the very end of the response, we can also add a short couple of words for Doomguy to say to the engineers reading the dashboard. He can be funny or serious. If there is a warning or critical item, then his words should focus should be on the most important thing. Write this in the format: \'Doomguy says "<message>"\'.';
307+
console.log('[LocalLLM] Doomguy is ENABLED - instruction added to system prompt');
308+
} else {
309+
console.log('[LocalLLM] Doomguy is DISABLED');
307310
}
308311

309312
try {
@@ -467,15 +470,14 @@ export default function LocalLLM() {
467470
}
468471
}
469472

470-
// Extract "Doomguy says" pattern from the response
471-
// Pattern: Doomguy says "<something>" (with or without the period at the end)
472-
const doomguySaysRegex = /Doomguy says\s*"([^"]+)"\.?\s*/gi;
473+
// Extract 'Doomguy says "message"' from the response
474+
const doomguySaysRegex = /Doomguy says "([^"]+)"\.?\s*/gi;
473475
let doomguyMatch;
474476
let doomguySays = '';
475477

476478
// Find and extract the Doomguy says text, removing it from content
477479
while ((doomguyMatch = doomguySaysRegex.exec(content)) !== null) {
478-
doomguySays = doomguyMatch[1]; // Keep the last match if multiple
480+
doomguySays = doomguyMatch[1];
479481
}
480482

481483
// Remove all "Doomguy says" patterns from the content

0 commit comments

Comments
 (0)