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)
This commit is contained in:
balibabu 2024-08-23 17:01:35 +08:00 committed by GitHub
parent e18f407604
commit 6228b1bd53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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