summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-30 01:43:45 -0700
committerFuwn <[email protected]>2025-09-30 01:43:45 -0700
commite45237e44cadc9248f5248554c01e5e256b1a492 (patch)
treec51657abc70b808f9d02701777e4e47947ecd2c8
parentfix(gateway:moderationAgent): Update model response handling (diff)
downloadumabotdiscord-e45237e44cadc9248f5248554c01e5e256b1a492.tar.xz
umabotdiscord-e45237e44cadc9248f5248554c01e5e256b1a492.zip
style(gateway:aiModeration): Lint
-rw-r--r--packages/gateway/src/listeners/moderationAgent/utilities.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/gateway/src/listeners/moderationAgent/utilities.ts b/packages/gateway/src/listeners/moderationAgent/utilities.ts
index a5e6aec..0f9e2a8 100644
--- a/packages/gateway/src/listeners/moderationAgent/utilities.ts
+++ b/packages/gateway/src/listeners/moderationAgent/utilities.ts
@@ -362,7 +362,7 @@ Remember: Only enforce the exact rules provided. Do not make assumptions or inte
.replace(/,\s*}/g, "}")
.replace(/,\s*]/g, "]")
.replace(/(\w+):/g, '"$1":');
-
+
if (jsonContent.includes("'") && !jsonContent.includes('"')) {
jsonContent = jsonContent.replace(/'/g, '"');
} else if (jsonContent.includes("'") && jsonContent.includes('"')) {
@@ -376,7 +376,7 @@ Remember: Only enforce the exact rules provided. Do not make assumptions or inte
try {
let fallbackContent = content;
-
+
if (fallbackContent.includes("```json")) {
const match = fallbackContent.match(/```json\s*([\s\S]*?)\s*```/);
@@ -386,7 +386,7 @@ Remember: Only enforce the exact rules provided. Do not make assumptions or inte
if (match) fallbackContent = match[1].trim();
}
-
+
const jsonMatch = fallbackContent.match(/\{[\s\S]*\}/);
if (jsonMatch) fallbackContent = jsonMatch[0];