Ver código fonte

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 ano atrás
pai
commit
6228b1bd53
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 6 adições e 3 exclusões
  1. 6
    3
      web/src/hooks/llm-hooks.ts

+ 6
- 3
web/src/hooks/llm-hooks.ts Ver arquivo

@@ -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 {

Carregando…
Cancelar
Salvar