Bugfix: Simple Moderation, making the checks case-insensitive

This commit is contained in:
vinodkiran
2023-11-28 20:53:33 +05:30
parent bce8a4cf01
commit 887b003cdd
@@ -14,7 +14,7 @@ export class SimplePromptModerationRunner implements Moderation {
async checkForViolations(input: string): Promise<string> {
this.denyList.split('\n').forEach((denyListItem) => {
if (denyListItem && denyListItem !== '' && input.includes(denyListItem)) {
if (denyListItem && denyListItem !== '' && input.toLowerCase().includes(denyListItem.toLowerCase())) {
throw Error(this.moderationErrorMessage)
}
})