Skip to content

Commit

Permalink
fix: Filter out disabled values ​​from the llm options #2072 (#2073)
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
cike8899 authored Aug 23, 2024
1 parent e18f407 commit 6228b1b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/src/hooks/llm-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,19 @@ 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,
value: x.llm_name,
disabled: !x.available,
})),
};
});
})
.filter((x) => x.options.length > 0);
};

return {
Expand Down

0 comments on commit 6228b1b

Please sign in to comment.