From 147ca2991c52ea4cbabb1086d19e7a4a7de359ca Mon Sep 17 00:00:00 2001 From: skeptrune Date: Mon, 16 Dec 2024 13:26:39 -0800 Subject: [PATCH 01/22] bugfix: dataset tracking id not resetting --- .../dataset-settings/TrackingIdUpdater.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/frontends/dashboard/src/components/dataset-settings/TrackingIdUpdater.tsx b/frontends/dashboard/src/components/dataset-settings/TrackingIdUpdater.tsx index 1779425642..7dfb164d4e 100644 --- a/frontends/dashboard/src/components/dataset-settings/TrackingIdUpdater.tsx +++ b/frontends/dashboard/src/components/dataset-settings/TrackingIdUpdater.tsx @@ -39,17 +39,11 @@ export const TrackingIdUpdater = () => { }, })); - const [input, setInput] = createSignal( - "", // Replaced by context as soon as the memo syncs - ); - const [hasEdited, setHasEdited] = createSignal(false); + const [input, setInput] = createSignal(""); createEffect(() => { - // If the tracking id is the same as the current tracking id, then don't show the input - const orgTrackingId = datasetContext.dataset()?.dataset.tracking_id; - if (input() === "" && orgTrackingId && !hasEdited()) { - setInput(orgTrackingId); - } + const datasetTracking = datasetContext.dataset()?.dataset.tracking_id; + setInput(datasetTracking || ""); }); const handleSave = () => { @@ -68,10 +62,8 @@ export const TrackingIdUpdater = () => { placeholder="Enter Tracking ID..." class="rounded-md border px-2 py-1 text-sm" value={input() || ""} - onFocus={() => setHasEdited(true)} onInput={(e) => { setInput(e.currentTarget.value); - setHasEdited(true); }} /> Date: Mon, 16 Dec 2024 14:38:14 -0800 Subject: [PATCH 02/22] bugfix: remove unwrap error parsing uuid --- server/src/operators/qdrant_operator.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/src/operators/qdrant_operator.rs b/server/src/operators/qdrant_operator.rs index f8023c8f68..b6ced2d8e9 100644 --- a/server/src/operators/qdrant_operator.rs +++ b/server/src/operators/qdrant_operator.rs @@ -529,11 +529,7 @@ pub async fn update_qdrant_point_query( .to_owned() .iter_list() .unwrap() - .map(|id| { - id.to_string() - .parse::() - .expect("group_id must be a valid uuid") - }) + .filter_map(|id| id.to_string().parse::().ok()) .collect::>() } else { vec![] From 19f4e8e9070f01b93b861d64db117cee3aeaf681 Mon Sep 17 00:00:00 2001 From: skeptrune Date: Mon, 16 Dec 2024 14:31:28 -0800 Subject: [PATCH 03/22] bugfix: mobile tabs for demo page horizontally scroll now --- server/src/public/navbar.html | 2 +- server/src/public/page.html | 17 +++++++++++++---- server/src/public/tabs.html | 1 + server/static/output.css | 12 ++++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/server/src/public/navbar.html b/server/src/public/navbar.html index 9a41de8c8d..0d7cc5bf31 100644 --- a/server/src/public/navbar.html +++ b/server/src/public/navbar.html @@ -36,7 +36,7 @@
) : null} diff --git a/clients/search-component/src/TrieveModal/index.css b/clients/search-component/src/TrieveModal/index.css index c30e1c21b0..8d819c6291 100644 --- a/clients/search-component/src/TrieveModal/index.css +++ b/clients/search-component/src/TrieveModal/index.css @@ -499,7 +499,7 @@ body { } .brand-name { - @apply text-white px-1.5 py-1 rounded-md font-[500]; + @apply text-white px-1.5 py-1 rounded-md font-[500] whitespace-nowrap; } } } @@ -639,8 +639,7 @@ body { } &:focus { - border: 1.5px solid var(--tv-prop-brand-color); - transform: translateY(-0.1px) scale(1.0006); + border: 1px solid var(--tv-prop-brand-color); } } diff --git a/clients/search-component/src/utils/hooks/chat-context.tsx b/clients/search-component/src/utils/hooks/chat-context.tsx index 10e0466632..78e0c9d369 100644 --- a/clients/search-component/src/utils/hooks/chat-context.tsx +++ b/clients/search-component/src/utils/hooks/chat-context.tsx @@ -262,6 +262,12 @@ function ChatProvider({ children }: { children: React.ReactNode }) { const askQuestion = async (question?: string, group?: ChunkGroup) => { isDoneReading.current = false; + + if (!currentGroup && group) { + chatWithGroup(group); + setCurrentGroup(group); + } + setMessages((m) => [ ...m, [ @@ -274,11 +280,6 @@ function ChatProvider({ children }: { children: React.ReactNode }) { ], ]); - if (!currentGroup && group) { - chatWithGroup(group); - setCurrentGroup(group); - } - if (!currentTopic && !currentGroup && !group) { await createTopic({ question: question || currentQuestion }); } else { diff --git a/server/src/handlers/chunk_handler.rs b/server/src/handlers/chunk_handler.rs index 1b9971cbfa..efbe28e499 100644 --- a/server/src/handlers/chunk_handler.rs +++ b/server/src/handlers/chunk_handler.rs @@ -2466,7 +2466,6 @@ pub async fn generate_off_chunks( }; let chunk_ids = data.chunk_ids.clone(); - let prompt = data.prompt.clone(); let stream_response = data.stream_response; let context_options = data.context_options.clone(); @@ -2477,8 +2476,8 @@ pub async fn generate_off_chunks( DatasetConfiguration::from_json(dataset_org_plan_sub.dataset.server_configuration); let base_url = dataset_config.LLM_BASE_URL; - - let default_model = dataset_config.LLM_DEFAULT_MODEL; + let rag_prompt = dataset_config.RAG_PROMPT.clone(); + let chosen_model = dataset_config.LLM_DEFAULT_MODEL; let base_url = if base_url.is_empty() { "https://openrouter.ai/api/v1".into() @@ -2600,7 +2599,8 @@ pub async fn generate_off_chunks( let last_prev_message = prev_messages .last() - .expect("There needs to be at least 1 prior message"); + .expect("There needs to be at least 1 prior message") + .clone(); let mut prev_messages = prev_messages.clone(); @@ -2610,19 +2610,17 @@ pub async fn generate_off_chunks( .iter() .for_each(|message| messages.push(ChatMessage::from(message.clone()))); - let prompt = prompt.unwrap_or("Respond to the question or instruction using the docs and include the doc numbers that you used in square brackets at the end of the sentences that you used the docs for:\n\n".to_string()); - messages.push(ChatMessage::User { content: ChatMessageContent::Text(format!( "{} {}", - prompt, + rag_prompt, last_prev_message.content.clone() )), name: None, }); let parameters = ChatCompletionParameters { - model: default_model, + model: chosen_model, stream: stream_response, messages, top_p: None, @@ -2729,7 +2727,7 @@ pub async fn generate_off_chunks( json.to_string() }) .collect(), - user_message: prompt, + user_message: format!("{} {}", rag_prompt, last_prev_message.content.clone()), query_rating: String::new(), rag_type: "chosen_chunks".to_string(), llm_response: completion_content.clone(), @@ -2799,7 +2797,7 @@ pub async fn generate_off_chunks( json.to_string() }) .collect(), - user_message: prompt, + user_message: format!("{} {}", rag_prompt, last_prev_message.content.clone()), rag_type: "chosen_chunks".to_string(), query_rating: String::new(), llm_response: completion, diff --git a/server/src/public/page.html b/server/src/public/page.html index 0fef1b2e2b..f953a6afaf 100644 --- a/server/src/public/page.html +++ b/server/src/public/page.html @@ -4,7 +4,7 @@