插件改造:输出改为 OpenAI 协议,审核改走远程接口
response_guard.lua 重写:按 OpenAI 协议定位内容(choices[*].delta.content / message.content,支持多路径覆盖 tool_calls.arguments),判定改走远程 /chat/completions,拦截输出 400 content_policy_violation,审核不可用输出 503 safety_review_unavailable。 stream_redact.lua 改为 OpenAI SSE 全缓冲 PII 兜底,默认关闭;request_rewrite.lua 改为只重写最后一条 user 消息,默认关闭。 config.yaml 接口路径改为 /v1/chat/completions,停用缺模型文件的 guard_model 段与依赖 host.files 的 /upload 插件段,hook_timeout 调到 45s。 新增 tools/verify_plugins.py:13 个场景 57 项断言的契约校验。
This commit is contained in:
1 parent
e1f944f16d
commit
9218bdf1e8
6 files changed
+1967
-1288
No files matched your search
@@ -10,3 +10,6 @@ config.local.yaml
|
||||
.env
|
||||
tmp/
|
||||
*.log
|
||||
|
||||
# 本次改造前的插件备份
|
||||
_bak_before_openai/
|
||||
Reference in new issue
Block a user