From a02ab0a6d08f49bb389f6a1cc5eaae52b1ef59ae Mon Sep 17 00:00:00 2001 From: cdxker Date: Thu, 9 Jan 2025 19:52:03 -0800 Subject: [PATCH] feature: remove suggested queries context. --- .../src/utils/hooks/modal-context.tsx | 2 -- .../src/utils/hooks/useFollowupQuestions.ts | 1 - .../src/utils/hooks/useSuggestedQueries.ts | 1 - .../src/utils/hooks/useSuggestedQuestions.ts | 2 -- clients/search-component/src/utils/trieve.ts | 6 ------ .../src/pages/dataset/PublicPageSettings.tsx | 15 --------------- server/src/data/models.rs | 3 --- server/src/handlers/page_handler.rs | 2 -- server/src/public/search-component-code.html | 3 --- 9 files changed, 35 deletions(-) diff --git a/clients/search-component/src/utils/hooks/modal-context.tsx b/clients/search-component/src/utils/hooks/modal-context.tsx index a39b5b15f..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,6 @@ export type ModalProps = { showFloatingSearchIcon?: boolean; showFloatingInput?: boolean; inlineHeader?: string; - suggestedQueriesContext: string; groupTrackingId?: string; cleanGroupName?: string; }; @@ -155,7 +154,6 @@ 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, }; 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 = () => { /> -
-
- -