建议为 compat 增加 supportsDeveloperRole 开关,并澄清切换协议后如何配置思考强度 #2489
Small-Sagittarius
started this conversation in
Ideas
Replies: 1 comment
|
你对根因的分析是对的: 现成绕法是用 pi2dsh 装网关对应的 Pi provider 包。自带 transport 的 provider 会注册成 DSH 原生 route,它的 dsh plugin --profile web add pi2dsh
dsh plugin --profile web add <Pi provider 包>真实模型选择器和线上请求体都已验证:provider 声明的推理档位会出现在选择器,选中的值进入 stream; 这是绕过 settings 丢字段的 route,不是宣称上游 schema 已修。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
背景
部分自托管 / 企业网关是通用 OpenAI Chat Completions 兼容实现(如基于 Rust 的代理),只接受
system/user/assistant/tool/latest_reminder角色,不认 OpenAI 较新引入的developer角色。当compat里配置了推理相关开关(如supportsReasoningEffort: true+reasoning: high),且模型声明了reasoningEfforts时,DSH 会以role: "developer"发送系统提示,这类网关直接返回 400:根因(已读源码确认)
pi-ai/dist/api/openai-completions.js:787:const useDeveloperRole = model.reasoning && compat.supportsDeveloperRole;detectCompat(同文件 :1148):对通用端点isNonStandard=false→ 默认探测supportsDeveloperRole = true。supportsDeveloperRole不是合法配置项:dsh-llm-pi-ai/lib/index.js:1333的compatProfileschema 只声明thinkingFormat与supportsReasoningEffort两个键;且resolveModelCompat(:1068)只把这两个键搬进model.compat,其它键一律丢弃。model.compat.supportsDeveloperRole永远读到undefined→ 回退探测值true→ 必发developer角色,且用户在 settings 里无法关闭它。建议
在
compat增加用户可覆盖的supportsDeveloperRole布尔开关,让不兼容的后端能强制用system角色:dsh-llm-pi-ai/lib/index.js的compatProfile增加字段:resolveModelCompat转发该键(与thinkingFormat/supportsReasoningEffort同处理):pi-ai的getCompat(openai-completions.js:1194)已是model.compat.supportsDeveloperRole ?? detected,无需改动。预期:默认行为不变(仍按探测值),仅当用户显式写
compat.supportsDeveloperRole: false时强制system角色。All reactions