浏览代码

fix: Filter out disabled values ​​from the llm options #2072 (#2073)

### What problem does this PR solve?

fix: Filter out disabled values ​​from the llm options #2072

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.11.0
balibabu 1年前
父节点
当前提交
6228b1bd53
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6
    3
      web/src/hooks/llm-hooks.ts

+ 6
- 3
web/src/hooks/llm-hooks.ts 查看文件

@@ -64,8 +64,10 @@ export const useSelectLlmOptionsByModelType = () => {
return {
label: key,
options: value
.filter((x) =>
modelType ? x.model_type.includes(modelType) : true,
.filter(
(x) =>
(modelType ? x.model_type.includes(modelType) : true) &&
x.available,
)
.map((x) => ({
label: x.llm_name,
@@ -73,7 +75,8 @@ export const useSelectLlmOptionsByModelType = () => {
disabled: !x.available,
})),
};
});
})
.filter((x) => x.options.length > 0);
};

return {

正在加载...
取消
保存