Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

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

balibabu6228b1bd53fd
diff --git a/web/src/hooks/llm-hooks.ts b/web/src/hooks/llm-hooks.ts
index 4c8eec6c57..a270c151a1 100644
--- a/web/src/hooks/llm-hooks.ts
+++ b/web/src/hooks/llm-hooks.ts
@@ -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 {