@aivue/moderation
v1.0.1
Published
AI content moderation for Vue — score UGC for hate, spam, violence, and more before publish
Maintainers
Readme
@aivue/moderation
AI content moderation for Vue 2 and Vue 3. Score UGC before publish; falls back to a lightweight heuristic if no client is provided.
Features
- Scores hate, harassment, sexual content, violence, self-harm, and spam
- A threshold you set before anything is published
- A lightweight heuristic when no API client is configured
AiModerationfor the panel,useModerationfor a check in code
Install
npm install @aivue/moderation @aivue/core vueUsage
<script setup>
import { ref } from 'vue';
import { AIClient } from '@aivue/core';
import { AiModeration } from '@aivue/moderation';
import '@aivue/moderation/style.css';
const client = new AIClient({ provider: 'openai', apiKey: import.meta.env.VITE_OPENAI_API_KEY });
const text = ref('');
</script>
<template>
<AiModeration v-model="text" :client="client" :threshold="0.5" />
</template>Offline heuristic
import { useModeration } from '@aivue/moderation';
const { check } = useModeration({ threshold: 0.4 }); // no client
await check('Buy now free crypto giveaway!!!');