feat(moderation): enhance media evidence handling and deferral analysis rejection

This commit is contained in:
MythEclipse
2026-05-29 17:32:04 +07:00
parent 0e9890db79
commit 2b1c436b3e
4 changed files with 278 additions and 61 deletions
+4 -1
View File
@@ -1,3 +1,4 @@
import { formatMediaEvidenceForPrompt } from "./messageMetadata.js";
import type { MessageRecord } from "./types.js";
export interface ConversationContextInput {
@@ -29,7 +30,9 @@ export function formatMessageForPrompt(
): string {
const content = msg.edited_content ?? msg.content;
const timestamp = formatTimestamp(msg.created_at);
return `[${label}] id=${msg.id} time=${timestamp} user=${msg.username}: ${content}`;
const mediaEvidence = formatMediaEvidenceForPrompt(msg.metadata);
const mediaSuffix = mediaEvidence ? ` ${mediaEvidence}` : "";
return `[${label}] id=${msg.id} time=${timestamp} user=${msg.username}: ${content}${mediaSuffix}`;
}
/**