diff --git a/frontends/chat/src/components/Layouts/MainLayout.tsx b/frontends/chat/src/components/Layouts/MainLayout.tsx index 15c920068d..901b8fca08 100644 --- a/frontends/chat/src/components/Layouts/MainLayout.tsx +++ b/frontends/chat/src/components/Layouts/MainLayout.tsx @@ -42,6 +42,24 @@ const getFiltersFromStorage = (datasetId: string) => { return parsedFilters; }; +const bm25Active = import.meta.env.VITE_BM25_ACTIVE as unknown as string; + +const default_settings = [ + { name: "Hybrid", route: "hybrid" }, + { + name: "FullText", + route: "fulltext", + }, + { + name: "Semantic", + route: "semantic", + }, +]; + +if (bm25Active) { + default_settings.push({ name: "BM25", route: "bm25" }); +} + const MainLayout = (props: LayoutProps) => { const apiHost = import.meta.env.VITE_API_HOST as unknown as string; @@ -72,6 +90,7 @@ const MainLayout = (props: LayoutProps) => { const [completionAbortController, setCompletionAbortController] = createSignal(new AbortController()); const [showFilterModal, setShowFilterModal] = createSignal(false); + const [searchType, setSearchType] = createSignal("hybrid"); const handleReader = async ( reader: ReadableStreamDefaultReader, @@ -201,6 +220,7 @@ const MainLayout = (props: LayoutProps) => { llm_options: { completion_first: streamCompletionsFirst(), }, + search_type: searchType(), }), signal: completionAbortController().signal, }); @@ -460,6 +480,23 @@ const MainLayout = (props: LayoutProps) => { }} /> +
+ + +