fix: address LLM square bracket mapping format and resolve Biome import formatting
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
cc2c247311
commit
1085d7909c
@@ -101,7 +101,10 @@ export function parseModerationResponse(
|
||||
throw new Error("Result missing 'message_id'");
|
||||
}
|
||||
|
||||
let finalId = String(message_id);
|
||||
let finalId = String(message_id).trim();
|
||||
if (finalId.startsWith("[") && finalId.endsWith("]")) {
|
||||
finalId = finalId.slice(1, -1).trim();
|
||||
}
|
||||
|
||||
// Precision loss fix: If the ID from LLM is not found,
|
||||
// try to find the closest match in targets if it looks rounded (ends in 000)
|
||||
|
||||
Reference in New Issue
Block a user