From 589bbc6835c222f40decfea068b4fa2095f8c552 Mon Sep 17 00:00:00 2001 From: ruwinirathnamalala Date: Wed, 24 Jun 2026 19:02:46 +0530 Subject: [PATCH] LLM connections page get filter options from dropdown --- DSL/Resql/rag-search/POST/get-llm-models.sql | 7 +++++ .../rag-search/GET/llm/models-list.yml | 20 +++++++++++++ GUI/src/pages/LLMConnections/index.tsx | 30 +++++++++++++------ GUI/src/services/llmConfigs.ts | 6 ++++ GUI/translations/en/common.json | 1 + GUI/translations/et/common.json | 1 + 6 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 DSL/Resql/rag-search/POST/get-llm-models.sql create mode 100644 DSL/Ruuter.private/rag-search/GET/llm/models-list.yml diff --git a/DSL/Resql/rag-search/POST/get-llm-models.sql b/DSL/Resql/rag-search/POST/get-llm-models.sql new file mode 100644 index 00000000..18df0970 --- /dev/null +++ b/DSL/Resql/rag-search/POST/get-llm-models.sql @@ -0,0 +1,7 @@ +SELECT + id, + platform_id, + model_key as value, + model_name as label +FROM rag_search.llm_models +ORDER BY model_name; \ No newline at end of file diff --git a/DSL/Ruuter.private/rag-search/GET/llm/models-list.yml b/DSL/Ruuter.private/rag-search/GET/llm/models-list.yml new file mode 100644 index 00000000..594520bb --- /dev/null +++ b/DSL/Ruuter.private/rag-search/GET/llm/models-list.yml @@ -0,0 +1,20 @@ +declaration: + call: declare + version: 0.1 + description: "Get LLM models by platform" + method: get + accepts: query + returns: json + namespace: rag-search + +get_llm_models: + call: http.post + args: + url: "[#RAG_SEARCH_RESQL]/get-llm-models" + result: models_result + next: return_success + +return_success: + return: ${models_result.response.body} + status: 200 + next: end \ No newline at end of file diff --git a/GUI/src/pages/LLMConnections/index.tsx b/GUI/src/pages/LLMConnections/index.tsx index 0af35601..83617ad7 100644 --- a/GUI/src/pages/LLMConnections/index.tsx +++ b/GUI/src/pages/LLMConnections/index.tsx @@ -18,6 +18,7 @@ import { llmConnectionsQueryKeys } from 'utils/queryKeys'; import { useToast } from 'hooks/useToast'; import { ToastTypes } from 'enums/commonEnums'; import useStore from 'store'; +import { getAllLLMModels, getLLMPlatforms } from 'services/llmConfigs'; const LLMConnections: FC = () => { const { t } = useTranslation(); @@ -49,6 +50,17 @@ const LLMConnections: FC = () => { }); + // Fetch platform and model options from API + const { data: llmPlatformsData = [], isLoading: llmPlatformsLoading, error: llmPlatformsError } = useQuery({ + queryKey: ['llm-platforms'], + queryFn: getLLMPlatforms + }); + + const { data: llmModels= [], isLoading: llmModelsLoading, error: llmModelsError } = useQuery({ + queryKey: ['llm-models'], + queryFn: getAllLLMModels, + }); + const llmConnections = connectionsResponse; const totalPages = connectionsResponse?.[0]?.totalPages || 1; @@ -107,21 +119,21 @@ const LLMConnections: FC = () => { setPageIndex(1); } }; - - // Platform filter options + const platformOptions = [ { label: t('dataModels.filters.allPlatforms'), value: 'all' }, - { label: t('dataModels.platforms.azure'), value: 'azure' }, - { label: t('dataModels.platforms.aws'), value: 'aws' }, + ...llmPlatformsData.map((platform) => ({ + label: platform.label, + value: platform.value, + })), ]; - // LLM Model filter options - these would ideally come from an API const llmModelOptions = [ { label: t('dataModels.filters.allModels'), value: 'all' }, - { label: t('dataModels.models.gpt4Mini'), value: 'gpt-4o-mini' }, - { label: t('dataModels.models.gpt4o'), value: 'gpt-4o' }, - { label: t('dataModels.models.claude35Sonnet'), value: 'anthropic-claude-3.5-sonnet' }, - { label: t('dataModels.models.claude37Sonnet'), value: 'anthropic-claude-3.7-sonnet' }, + ...llmModels.map((model) => ({ + label: model.label, + value: model.value, + })), ]; // Environment filter options diff --git a/GUI/src/services/llmConfigs.ts b/GUI/src/services/llmConfigs.ts index fc582a86..3776a112 100644 --- a/GUI/src/services/llmConfigs.ts +++ b/GUI/src/services/llmConfigs.ts @@ -45,4 +45,10 @@ export async function getEmbeddingModels(platformKey?: string): Promise { + const { data } = await apiDev.get('/rag-search/llm/models-list'); + return data?.response; } \ No newline at end of file diff --git a/GUI/translations/en/common.json b/GUI/translations/en/common.json index 21ef0c42..09178417 100644 --- a/GUI/translations/en/common.json +++ b/GUI/translations/en/common.json @@ -172,6 +172,7 @@ "aws": "AWS Bedrock" }, "models": { + "gpt4.1": "GPT-4.1", "gpt4Mini": "GPT-4 Mini", "gpt4o": "GPT-4o", "claude35Sonnet": "Anthropic Claude 3.5 Sonnet", diff --git a/GUI/translations/et/common.json b/GUI/translations/et/common.json index b08826b4..c4e41f87 100644 --- a/GUI/translations/et/common.json +++ b/GUI/translations/et/common.json @@ -172,6 +172,7 @@ "aws": "AWS Bedrock" }, "models": { + "gpt4.1": "GPT-4.1", "gpt4Mini": "GPT-4 Mini", "gpt4o": "GPT-4o", "claude35Sonnet": "Anthropic Claude 3.5 Sonnet",