护栏与审查

mastra-jev-moderation

@CodeAlive-AI2TypeScriptMIT更新于 2026-09-18可当场跑

Mastra agent 在 TypeSafe Jev 上的输入内容审核工具,单文件实现。

英文原文

Input moderation for Mastra agents on TypeSafe Jev — one file

CodeAlive-AI/mastra-jev-moderation

它在哪儿调用了 Jev

export const JEV_ENDPOINT = "https://api.typesafe.ai/v1/systemone";

jev-moderation.ts:33

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 jev-moderation.ts:164

  1. blocking是/否

    ${context}`message` is what a user typed to the assistant. Must `message` be blocked before it reaches the assistant?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    blocking: { type: 'boolean', instructions: '${context}`message` is what a user typed to the assistant. Must `message` be blocked before it reaches the assistant?' },
  },
});

同类的其他项目