diff --git a/clients/search-component/example/src/routeTree.gen.ts b/clients/search-component/example/src/routeTree.gen.ts index 740177945..25f03397c 100644 --- a/clients/search-component/example/src/routeTree.gen.ts +++ b/clients/search-component/example/src/routeTree.gen.ts @@ -1,12 +1,12 @@ -/* prettier-ignore-start */ - /* eslint-disable */ // @ts-nocheck // noinspection JSUnusedGlobalSymbols -// This file is auto-generated by TanStack Router +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { createFileRoute } from '@tanstack/react-router' @@ -22,11 +22,13 @@ const IndexLazyImport = createFileRoute('/')() // Create/Update Routes const EcommerceRoute = EcommerceImport.update({ + id: '/ecommerce', path: '/ecommerce', getParentRoute: () => rootRoute, } as any) const IndexLazyRoute = IndexLazyImport.update({ + id: '/', path: '/', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/index.lazy').then((d) => d.Route)) @@ -93,8 +95,6 @@ export const routeTree = rootRoute ._addFileChildren(rootRouteChildren) ._addFileTypes() -/* prettier-ignore-end */ - /* ROUTE_MANIFEST_START { "routes": { diff --git a/clients/search-component/package.json b/clients/search-component/package.json index 2dd095ce7..d84dac30d 100644 --- a/clients/search-component/package.json +++ b/clients/search-component/package.json @@ -19,7 +19,7 @@ "import": "./dist/vanilla/index.js" } }, - "version": "0.3.7", + "version": "0.3.8", "license": "MIT", "homepage": "https://github.com/devflowinc/trieve/tree/main/clients/search-component", "scripts": { diff --git a/clients/search-component/src/TrieveModal/Chat/ChatMode.tsx b/clients/search-component/src/TrieveModal/Chat/ChatMode.tsx index 492c8f25f..b136aede8 100644 --- a/clients/search-component/src/TrieveModal/Chat/ChatMode.tsx +++ b/clients/search-component/src/TrieveModal/Chat/ChatMode.tsx @@ -40,7 +40,7 @@ export const ChatMode = () => { }, [chatInput, mode, open]); return ( - + HIIIIII}> {props.inline && messages.length ? (
diff --git a/clients/search-component/src/TrieveModal/Search/SearchMode.tsx b/clients/search-component/src/TrieveModal/Search/SearchMode.tsx index 990d05de2..8d5426c50 100644 --- a/clients/search-component/src/TrieveModal/Search/SearchMode.tsx +++ b/clients/search-component/src/TrieveModal/Search/SearchMode.tsx @@ -123,7 +123,7 @@ export const SearchMode = () => { }, [results]); return ( -
}> + HIIIIII
}>
setOpen(false)} diff --git a/clients/search-component/src/TrieveModal/index.css b/clients/search-component/src/TrieveModal/index.css index eda840cae..7f9156f46 100644 --- a/clients/search-component/src/TrieveModal/index.css +++ b/clients/search-component/src/TrieveModal/index.css @@ -23,7 +23,7 @@ body { } #trieve-search-modal { - @apply animate-contentShow scroll-smooth max-h-[60vh] w-[90vw] sm:max-w-[800px] rounded-lg focus:outline-none overflow-hidden text-base; + @apply scroll-smooth max-h-[60vh] w-[90vw] sm:max-w-[800px] rounded-lg focus:outline-none overflow-hidden text-base; color: var(--tv-zinc-950); background-color: #fff; diff --git a/clients/search-component/src/utils/hooks/chat-context.tsx b/clients/search-component/src/utils/hooks/chat-context.tsx index dc82af740..c5fc3c503 100644 --- a/clients/search-component/src/utils/hooks/chat-context.tsx +++ b/clients/search-component/src/utils/hooks/chat-context.tsx @@ -88,6 +88,7 @@ function ChatProvider({ children }: { children: React.ReactNode }) { const clearConversation = () => { setCurrentTopic(""); + setCurrentGroup(null); setMessages([]); }; @@ -201,7 +202,7 @@ function ChatProvider({ children }: { children: React.ReactNode }) { llm_options: { completion_first: false, }, - page_size: props.searchOptions?.page_size ?? 5, + page_size: props.searchOptions?.page_size ?? 8, score_threshold: props.searchOptions?.score_threshold || null, use_group_search: props.useGroupSearch, filters: @@ -258,6 +259,25 @@ function ChatProvider({ children }: { children: React.ReactNode }) { const askQuestion = async (question?: string, group?: ChunkGroup) => { setIsDoneReading(false); + if (props.groupTrackingId) { + + const fetchedGroup = await trieveSDK.getGroupByTrackingId({ + trackingId: props.groupTrackingId + }); + if (fetchedGroup) { + group = { + created_at: fetchedGroup.created_at, + updated_at: fetchedGroup.updated_at, + dataset_id: fetchedGroup.dataset_id, + description: fetchedGroup.description, + id: fetchedGroup.id, + metadata: fetchedGroup.metadata, + name: props.cleanGroupName ? props.cleanGroupName : fetchedGroup.name, + tag_set: fetchedGroup.tag_set, + } as ChunkGroup; + } + } + if (!currentGroup && group) { chatWithGroup(group); setCurrentGroup(group); diff --git a/clients/search-component/src/utils/hooks/modal-context.tsx b/clients/search-component/src/utils/hooks/modal-context.tsx index de0ee85a9..65b5960a0 100644 --- a/clients/search-component/src/utils/hooks/modal-context.tsx +++ b/clients/search-component/src/utils/hooks/modal-context.tsx @@ -109,7 +109,8 @@ export type ModalProps = { showFloatingSearchIcon?: boolean; showFloatingInput?: boolean; inlineHeader?: string; - suggestedQueriesContext: string; + groupTrackingId?: string; + cleanGroupName?: string; }; const defaultProps = { @@ -153,7 +154,8 @@ const defaultProps = { showFloatingInput: false, inline: false, inlineHeader: "AI Assistant by Trieve", - suggestedQueriesContext: "You are an ecommerce sales assistant to help people buy items." + groupTrackingId: undefined, + cleanGroupName: undefined, }; const ModalContext = createContext<{ diff --git a/clients/search-component/src/utils/hooks/useFollowupQuestions.ts b/clients/search-component/src/utils/hooks/useFollowupQuestions.ts index 4c36f1c72..2488104e0 100644 --- a/clients/search-component/src/utils/hooks/useFollowupQuestions.ts +++ b/clients/search-component/src/utils/hooks/useFollowupQuestions.ts @@ -18,7 +18,6 @@ export const useFollowupQuestions = () => { trieve: trieveSDK, query: currentQuestion, count: props.numberOfSuggestions ?? 3, - context: props.suggestedQueriesContext, group: currentGroup }); setSuggestedQuestions(queries.queries); diff --git a/clients/search-component/src/utils/hooks/useSuggestedQueries.ts b/clients/search-component/src/utils/hooks/useSuggestedQueries.ts index 7ca221054..c5fe2a358 100644 --- a/clients/search-component/src/utils/hooks/useSuggestedQueries.ts +++ b/clients/search-component/src/utils/hooks/useSuggestedQueries.ts @@ -21,7 +21,6 @@ export const useSuggestedQueries = () => { trieve: trieveSDK, query, count: props.numberOfSuggestions ?? 3, - context: props.suggestedQueriesContext, abortController, }); setSuggestedQueries(queries.queries); diff --git a/clients/search-component/src/utils/hooks/useSuggestedQuestions.ts b/clients/search-component/src/utils/hooks/useSuggestedQuestions.ts index 0059b6a19..c3f7d6875 100644 --- a/clients/search-component/src/utils/hooks/useSuggestedQuestions.ts +++ b/clients/search-component/src/utils/hooks/useSuggestedQuestions.ts @@ -15,7 +15,6 @@ export const useSuggestedQuestions = () => { const queries = await getSuggestedQuestions({ trieve: trieveSDK, count: props.numberOfSuggestions ?? 3, - context: props.suggestedQueriesContext, query, }); setSuggestedQuestions(queries.queries); @@ -39,7 +38,6 @@ export const useSuggestedQuestions = () => { const queries = await getSuggestedQuestions({ trieve: trieveSDK, count: props.numberOfSuggestions ?? 3, - context: props.suggestedQueriesContext, abortController, query, }); diff --git a/clients/search-component/src/utils/trieve.ts b/clients/search-component/src/utils/trieve.ts index f80b33710..8316cd168 100644 --- a/clients/search-component/src/utils/trieve.ts +++ b/clients/search-component/src/utils/trieve.ts @@ -259,13 +259,11 @@ export const getSuggestedQueries = async ({ trieve, query, count, - context, abortController, }: { query: string; trieve: TrieveSDK; count: number; - context: string; abortController?: AbortController; }) => { return trieve.suggestedQueries( @@ -274,7 +272,6 @@ export const getSuggestedQueries = async ({ suggestion_type: "keyword", suggestions_to_create: count, search_type: "semantic", - context: context }, abortController?.signal ); @@ -283,14 +280,12 @@ export const getSuggestedQueries = async ({ export const getSuggestedQuestions = async ({ trieve, abortController, - context, query, count, group, }: { trieve: TrieveSDK; abortController?: AbortController; - context: string; query?: string; count: number; group?: ChunkGroup | null; @@ -300,7 +295,6 @@ export const getSuggestedQuestions = async ({ ...(query && { query }), suggestion_type: "question", search_type: "semantic", - context: context, suggestions_to_create: count, ...(group && group?.tracking_id && { diff --git a/frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx b/frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx index 2c40a2dad..3db0f6ce2 100644 --- a/frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx +++ b/frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx @@ -1073,21 +1073,6 @@ const PublicPageControls = () => { />
-
-
- -