Llama Guard 3's verdicts carry their hazards' names without a categories list

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-06 12:44:53 +02:00
1 parent 249a91aeec
commit 4721b8e353
1 file changed
+4
+4
View File
@@ -294,6 +294,10 @@ func parseJudgment(format string, names []string, body []byte, answer string) (j
}
switch format {
case "llamaguard3":
if len(names) == 0 {
// Its own: S1 is Violent Crimes, S9 Indiscriminate Weapons.
names = llamaGuard3Categories
}
lines := strings.Split(text, "\n")
switch strings.ToLower(strings.TrimSpace(lines[0])) {
case "safe":