Browse Source

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 year ago
parent
commit
6228b1bd53
No account linked to committer's email address
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      web/src/hooks/llm-hooks.ts

+ 6
- 3
web/src/hooks/llm-hooks.ts View File

return { return {
label: key, label: key,
options: value options: value
.filter((x) =>
modelType ? x.model_type.includes(modelType) : true,
.filter(
(x) =>
(modelType ? x.model_type.includes(modelType) : true) &&
x.available,
) )
.map((x) => ({ .map((x) => ({
label: x.llm_name, label: x.llm_name,
disabled: !x.available, disabled: !x.available,
})), })),
}; };
});
})
.filter((x) => x.options.length > 0);
}; };


return { return {

Loading…
Cancel
Save