使用 OpenAI 格式的 LLM 接口进行内容审查的 Koishi Censor 服务插件。
功能
-
支持任意兼容 OpenAI Chat Completions API 的 LLM 服务(OpenAI、DeepSeek、Ollama 等)
-
自定义 API 地址和模型名称
-
自定义审查提示词 (system prompt)
-
支持文本内容审查,自动替换敏感词为
* -
完整实现
@koishijs/censor服务接口
配置项
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| apiEndpoint | string |
https://api.openai.com/v1/chat/completions |
OpenAI 兼容 API 地址 |
| apiKey | string |
(必填) | API 密钥 |
| model | string |
gpt-4o-mini |
模型名称 |
| systemPrompt | string |
(内置提示词) | 自定义审查提示词 |
| temperature | number |
0 |
温度参数 |
| timeout | number |
30000 |
请求超时(ms) |