guard: 所有出站请求体统一为 OpenAI Chat Completions 规范
占位请求(encode_stub)原先写死 max_tokens=1 + temperature=0,且客户端没给 model 时
直接不发 model——上游是 o 系列/gpt-5 会因 max_tokens、temperature 直接 400,
也因为缺 model 报错。改为只发规范字段:
{model, messages:[{role:user,content:/ping/}], stream, max_tokens?}
- model:客户端原值;缺省用新增的 stub_model 兜底
- stream:显式布尔,不再是「有才发」
- max_tokens:新增 stub_max_tokens,默认 16,设 false 则不发送
判定请求(judge_body)本已是标准形态,未改动。
verify_plugins.py 新增 [17] 占位请求形态用例(12 项),共 97 项;mock 与真实后端均 97/97。
This commit is contained in:
1 parent
7b2f709b86
commit
5b4438a306
4 files changed
+100
-9
No files matched your search
@@ -71,6 +71,12 @@ plugins:
|
||||
# judge_temperature: false
|
||||
# 后端不支持 response_format 时关掉,仅靠 system_prompt 约束输出 JSON。
|
||||
# judge_json_mode: false
|
||||
# ---- 拦截后替换给上游的占位请求(原文不出网关)----
|
||||
# 默认形态即最小合规请求:{model, messages:[{role:user,content:"ping"}], stream, max_tokens:16}
|
||||
# 客户端请求里没有 model 时用下面这个兜底(OpenAI 规范要求 model 必填):
|
||||
# stub_model: deepseek-v4-pro
|
||||
# 上游换成 gpt-5 / o 系列(只认 max_completion_tokens)时设 false,不发 max_tokens:
|
||||
# stub_max_tokens: false
|
||||
check_input: true
|
||||
check_output: true
|
||||
|
||||
|
||||
Reference in new issue
Block a user