Skip to content

Commit

Permalink
feature: remove suggested queries context.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdxker committed Jan 10, 2025
1 parent 0648bad commit a02ab0a
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 35 deletions.
2 changes: 0 additions & 2 deletions clients/search-component/src/utils/hooks/modal-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export type ModalProps = {
showFloatingSearchIcon?: boolean;
showFloatingInput?: boolean;
inlineHeader?: string;
suggestedQueriesContext: string;
groupTrackingId?: string;
cleanGroupName?: string;
};
Expand Down Expand Up @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const useFollowupQuestions = () => {
trieve: trieveSDK,
query: currentQuestion,
count: props.numberOfSuggestions ?? 3,
context: props.suggestedQueriesContext,
group: currentGroup
});
setSuggestedQuestions(queries.queries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const useSuggestedQueries = () => {
trieve: trieveSDK,
query,
count: props.numberOfSuggestions ?? 3,
context: props.suggestedQueriesContext,
abortController,
});
setSuggestedQueries(queries.queries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const useSuggestedQuestions = () => {
const queries = await getSuggestedQuestions({
trieve: trieveSDK,
count: props.numberOfSuggestions ?? 3,
context: props.suggestedQueriesContext,
query,
});
setSuggestedQuestions(queries.queries);
Expand All @@ -39,7 +38,6 @@ export const useSuggestedQuestions = () => {
const queries = await getSuggestedQuestions({
trieve: trieveSDK,
count: props.numberOfSuggestions ?? 3,
context: props.suggestedQueriesContext,
abortController,
query,
});
Expand Down
6 changes: 0 additions & 6 deletions clients/search-component/src/utils/trieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -274,7 +272,6 @@ export const getSuggestedQueries = async ({
suggestion_type: "keyword",
suggestions_to_create: count,
search_type: "semantic",
context: context
},
abortController?.signal
);
Expand All @@ -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;
Expand All @@ -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 && {
Expand Down
15 changes: 0 additions & 15 deletions frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1073,21 +1073,6 @@ const PublicPageControls = () => {
/>
</div>

<div class="flex gap-4 pb-2 pt-2">
<div class="grow">
<label class="block">Suggested Queries Context</label>
<textarea
cols={2}
placeholder="You are an ecommerce sales assistant to help people buy items."
value={ extraParams.suggestedQueriesContext || ""}
onInput={(e) => {
setExtraParams("suggestedQueriesContext", e.currentTarget.value)
}}
class="block w-full rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
/>
</div>
</div>

<div class="grid grid-cols-2 gap-4">
<div class="flex gap-2">
<div class="flex items-center gap-1">
Expand Down
3 changes: 0 additions & 3 deletions server/src/data/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3297,9 +3297,6 @@ impl DatasetConfigurationDTO {
inline_header: page_parameters_self
.inline_header
.or(page_parameters_curr.inline_header),
suggested_queries_context: page_parameters_self
.suggested_queries_context
.or(page_parameters_curr.suggested_queries_context),
}),
},
DISABLE_ANALYTICS: self
Expand Down
2 changes: 0 additions & 2 deletions server/src/handlers/page_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ pub struct PublicPageParameters {
pub number_of_suggestions: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub inline_header: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub suggested_queries_context: Option<String>,
}

#[utoipa::path(
Expand Down
3 changes: 0 additions & 3 deletions server/src/public/search-component-code.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
{% if params.inline -%}
inline: {{ params.inline }},
{% endif -%}
{% if params.suggestedQueriesContext -%}
suggestedQueriesContext: "{{ params.suggestedQueriesContext }}",
{% endif -%}
{% if params.analytics -%}
analytics: {{ params.analytics }},
{% endif -%}
Expand Down

0 comments on commit a02ab0a

Please sign in to comment.