fixes handling of DALL-E content_policy_violation errors

This commit is contained in:
nai-degen 2024-03-07 12:56:35 -06:00
parent 1fb3eac154
commit 96756d32f3
2 changed files with 3 additions and 5 deletions

View File

@ -209,9 +209,7 @@ export function buildSpoofedCompletion({
],
};
case "openai-image":
throw new Error(
`Spoofed completions not supported for ${format} requests`
);
return obj;
default:
assertNever(format);
}
@ -287,7 +285,7 @@ export function buildSpoofedSSE({
],
});
case "openai-image":
throw new Error(`SSE not supported for ${format} requests`);
return JSON.stringify(obj);
default:
assertNever(format);
}

View File

@ -146,7 +146,7 @@ export class AnthropicKeyChecker extends KeyCheckerBase<AnthropicKey> {
} else if (COPYRIGHT_PROMPT.some((re) => re.test(completion))) {
this.log.info(
{ key: key.hash, response: completion },
"Key is has copyright CYA prompt."
"Key has copyright CYA prompt."
);
return { pozzed: true };
} else {