severityscore各选项置信度
0 · 安全88%
1 · 临界10%
2 · 违规2%
3 · 必须删除1%
Playground
这条帖子会被删除吗?关于周一会议的玩笑可保留;针对群体的辱骂会被标记删除。
{ "post": "周一早上的会议本可以是一封邮件,而这封邮件本可以不存在。☕️ #打工人"}
这两个示例仅有一处细节不同。结果随之变化。
变化之处办公室玩笑 → 针对群体的辱骂
severityscore0 · 安全1 · 临界2 · 违规3 · 必须删除targetsGroupnoul设置 SYSTEM_ONE_API_KEY。代码片段使用已发布的目录模型 ID。
{"model":"decider-v1.1","state":{"post":"周一早上的会议本可以是一封邮件,而这封邮件本可以不存在。☕️ #打工人"},"questions":{"severity":{"type":"score","instructions":"How would a typical platform policy rate this post?","criteria":["安全","临界","违规","必须删除"]},"targetsGroup":{"type":"noul","instructions":"Does the post attack a specific protected group?"}}}curl "https://system-one.dev/v1/systemone" \ -H "Authorization: Bearer $SYSTEM_ONE_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: saved-operation-id' \ --data '{"model":"decider-v1.1","state":{"post":"周一早上的会议本可以是一封邮件,而这封邮件本可以不存在。☕️ #打工人"},"questions":{"severity":{"type":"score","instructions":"How would a typical platform policy rate this post?","criteria":["安全","临界","违规","必须删除"]},"targetsGroup":{"type":"noul","instructions":"Does the post attack a specific protected group?"}}}'// npm install @system-one-ai/core@0.8.0 @system-one-ai/adapter-system-one@0.7.0 @system-one-ai/transport-fetch@0.8.0import { createSystemOne, choice, score, booleanQuestion } from '@system-one-ai/core';import { systemOneAdapter } from '@system-one-ai/adapter-system-one';import { createFetchTransport } from '@system-one-ai/transport-fetch';const client = createSystemOne({ baseURL: "https://system-one.dev/v1", apiKey: process.env.SYSTEM_ONE_API_KEY!, model: "decider-v1.1", adapter: systemOneAdapter, transport: createFetchTransport(), timeoutMs: 30_000, maxRetries: 0,});const result = await client.evaluate({ state: { "post": "周一早上的会议本可以是一封邮件,而这封邮件本可以不存在。☕️ #打工人" }, questions: { severity: score("How would a typical platform policy rate this post?", ["安全", "临界", "违规", "必须删除"]), targetsGroup: booleanQuestion("Does the post attack a specific protected group?"), },}, { headers: { 'Idempotency-Key': crypto.randomUUID() } });result.answers.severity.scoreresult.answers.targetsGroup.probabilityresult.response.requestId;