balibabu commited on
Commit
788c296
·
1 Parent(s): b71a073

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

Browse files

### 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)

Files changed (1) hide show
  1. web/src/hooks/llm-hooks.ts +6 -3
web/src/hooks/llm-hooks.ts CHANGED
@@ -64,8 +64,10 @@ export const useSelectLlmOptionsByModelType = () => {
64
  return {
65
  label: key,
66
  options: value
67
- .filter((x) =>
68
- modelType ? x.model_type.includes(modelType) : true,
 
 
69
  )
70
  .map((x) => ({
71
  label: x.llm_name,
@@ -73,7 +75,8 @@ export const useSelectLlmOptionsByModelType = () => {
73
  disabled: !x.available,
74
  })),
75
  };
76
- });
 
77
  };
78
 
79
  return {
 
64
  return {
65
  label: key,
66
  options: value
67
+ .filter(
68
+ (x) =>
69
+ (modelType ? x.model_type.includes(modelType) : true) &&
70
+ x.available,
71
  )
72
  .map((x) => ({
73
  label: x.llm_name,
 
75
  disabled: !x.available,
76
  })),
77
  };
78
+ })
79
+ .filter((x) => x.options.length > 0);
80
  };
81
 
82
  return {