mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
fix: 缓存开关仅 qwen/豆包显示,消除 openai provider 的按钮泄漏
缓存字段挂在共享的 openai provider 上,导致智谱/DeepSeek/讯飞/LMStudio/ 火山网关等所有 openai 兼容模型都带出了「是否开启缓存」按钮,但它们并不支持。 ModelEditDialog.vue / AddModelDialog.vue:openai provider 下 cache 字段仅当 base_url 含 aliyuncs(即 qwen)时渲染;豆包走 doubao_cache provider,不受影响。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
330d3a20ca
commit
1516820dfe
2 changed files with 36 additions and 14 deletions
|
|
@ -143,7 +143,15 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
dynamicCallInfoFields() {
|
||||
return this.providerFields;
|
||||
// 缓存开关仅 qwen(aliyuncs) 显示;豆包走 doubao_cache provider,不在此过滤
|
||||
const baseUrl = (this.formData.configJson && this.formData.configJson.base_url) || "";
|
||||
const supplier = this.formData.supplier;
|
||||
return this.providerFields.filter((f) => {
|
||||
if (f.prop === "cache" && supplier === "openai") {
|
||||
return String(baseUrl).includes("aliyuncs");
|
||||
}
|
||||
return true;
|
||||
});
|
||||
},
|
||||
chunkedCallInfoFields() {
|
||||
const chunkSize = 2;
|
||||
|
|
|
|||
|
|
@ -324,19 +324,33 @@ export default {
|
|||
(p) => p.providerCode === providerCode
|
||||
);
|
||||
if (provider) {
|
||||
this.dynamicCallInfoFields = JSON.parse(provider.fields || "[]").map((f) => ({
|
||||
label: f.label,
|
||||
prop: f.key,
|
||||
type:
|
||||
f.type === "dict"
|
||||
? "json-textarea"
|
||||
: f.type === "boolean"
|
||||
? "boolean"
|
||||
: f.type === "password"
|
||||
? "password"
|
||||
: "text",
|
||||
placeholder: `请输入${f.key}`,
|
||||
}));
|
||||
const baseUrl =
|
||||
(this.pendingModelData &&
|
||||
this.pendingModelData.configJson &&
|
||||
this.pendingModelData.configJson.base_url) ||
|
||||
this.form.configJson.base_url ||
|
||||
"";
|
||||
this.dynamicCallInfoFields = JSON.parse(provider.fields || "[]")
|
||||
.map((f) => ({
|
||||
label: f.label,
|
||||
prop: f.key,
|
||||
type:
|
||||
f.type === "dict"
|
||||
? "json-textarea"
|
||||
: f.type === "boolean"
|
||||
? "boolean"
|
||||
: f.type === "password"
|
||||
? "password"
|
||||
: "text",
|
||||
placeholder: `请输入${f.key}`,
|
||||
}))
|
||||
.filter((f) => {
|
||||
// 缓存开关仅 qwen(aliyuncs) 显示;豆包走 doubao_cache provider,不在此过滤
|
||||
if (f.prop === "cache" && providerCode === "openai") {
|
||||
return String(baseUrl).includes("aliyuncs");
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
if (this.pendingModelData && this.pendingProviderType === providerCode) {
|
||||
this.processModelData(this.pendingModelData);
|
||||
|
|
|
|||
Loading…
Reference in a new issue