From 472e3094a3e845de1d7d4b26584b6f96a1941a5e Mon Sep 17 00:00:00 2001 From: ChoudharyHarish Date: Mon, 18 Nov 2024 12:35:18 +0530 Subject: [PATCH] added default model selection --- .../dashboard/docsqa/main/components/ConfigSidebar.tsx | 2 ++ frontend/src/screens/dashboard/docsqa/main/context.tsx | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/frontend/src/screens/dashboard/docsqa/main/components/ConfigSidebar.tsx b/frontend/src/screens/dashboard/docsqa/main/components/ConfigSidebar.tsx index 4ed5419f..2d7541ff 100644 --- a/frontend/src/screens/dashboard/docsqa/main/components/ConfigSidebar.tsx +++ b/frontend/src/screens/dashboard/docsqa/main/components/ConfigSidebar.tsx @@ -36,6 +36,8 @@ const Left = (props: any) => { resetQA, } = useDocsQAContext() + console.log(selectedQueryModel) + const { setIsCreateApplicationModalOpen } = props return ( diff --git a/frontend/src/screens/dashboard/docsqa/main/context.tsx b/frontend/src/screens/dashboard/docsqa/main/context.tsx index a90be78c..eda5f47d 100644 --- a/frontend/src/screens/dashboard/docsqa/main/context.tsx +++ b/frontend/src/screens/dashboard/docsqa/main/context.tsx @@ -101,6 +101,12 @@ export const DocsQAProvider: React.FC = ({ children }) => { setSelectedQueryController(allQueryControllers[0]) }, [allQueryControllers]) + useEffect(() => { + if (allEnabledModels && allEnabledModels.length) { + setSelectedQueryModel(allEnabledModels[0].name) + } + }, [allEnabledModels]) + useEffect(() => { if (allRetrieverOptions && allRetrieverOptions.length) { setSelectedRetriever(allRetrieverOptions[0])