diff --git a/web/src/components/search/SearchResultsDisplay.tsx b/web/src/components/search/SearchResultsDisplay.tsx
index 64383b217d..c16da67832 100644
--- a/web/src/components/search/SearchResultsDisplay.tsx
+++ b/web/src/components/search/SearchResultsDisplay.tsx
@@ -11,7 +11,6 @@ import {
} from "@/lib/search/interfaces";
import { QAFeedbackBlock } from "./QAFeedback";
import { DocumentDisplay } from "./DocumentDisplay";
-import { ResponseSection, StatusOptions } from "./results/ResponseSection";
import { QuotesSection } from "./results/QuotesSection";
import { AnswerSection } from "./results/AnswerSection";
import { ThreeDots } from "react-loader-spinner";
@@ -50,7 +49,7 @@ export const SearchResultsDisplay = ({
}
const isPersona = personaName !== null;
- const { answer, quotes, documents, error, queryEventId } = searchResponse;
+ const { answer, quotes, documents, error, messageId } = searchResponse;
if (isFetching && !answer && !documents) {
return (
@@ -147,10 +146,10 @@ export const SearchResultsDisplay = ({
isAnswerable={validQuestionResponse.answerable}
/>
- {searchResponse.queryEventId !== null && (
+ {searchResponse.messageId !== null && (
@@ -166,11 +165,12 @@ export const SearchResultsDisplay = ({
Results
- {removeDuplicateDocs(documents).map((document) => (
+ {removeDuplicateDocs(documents).map((document, ind) => (
diff --git a/web/src/components/search/SearchSection.tsx b/web/src/components/search/SearchSection.tsx
index 87d1cddcab..383d6a936f 100644
--- a/web/src/components/search/SearchSection.tsx
+++ b/web/src/components/search/SearchSection.tsx
@@ -95,7 +95,7 @@ export const SearchSection = ({
suggestedFlowType: null,
selectedDocIndices: null,
error: null,
- queryEventId: null,
+ messageId: null,
};
const updateCurrentAnswer = (answer: string) =>
setSearchResponse((prevState) => ({
@@ -132,10 +132,10 @@ export const SearchSection = ({
...(prevState || initialSearchResponse),
error,
}));
- const updateQueryEventId = (queryEventId: number) =>
+ const updateMessageId = (messageId: number) =>
setSearchResponse((prevState) => ({
...(prevState || initialSearchResponse),
- queryEventId,
+ messageId,
}));
let lastSearchCancellationToken = useRef
(null);
@@ -190,9 +190,9 @@ export const SearchSection = ({
cancellationToken: lastSearchCancellationToken.current,
fn: updateError,
}),
- updateQueryEventId: cancellable({
+ updateMessageId: cancellable({
cancellationToken: lastSearchCancellationToken.current,
- fn: updateQueryEventId,
+ fn: updateMessageId,
}),
selectedSearchType: searchType ?? selectedSearchType,
offset: offset ?? defaultOverrides.offset,
diff --git a/web/src/lib/search/interfaces.ts b/web/src/lib/search/interfaces.ts
index a0ffe057a0..83c2b407ab 100644
--- a/web/src/lib/search/interfaces.ts
+++ b/web/src/lib/search/interfaces.ts
@@ -62,10 +62,6 @@ export interface LLMRelevanceFilterPacket {
relevant_chunk_indices: number[];
}
-export interface QueryEventIdPacket {
- query_event_id: number;
-}
-
export interface SearchResponse {
suggestedSearchType: SearchType | null;
suggestedFlowType: FlowType | null;
@@ -74,7 +70,7 @@ export interface SearchResponse {
documents: DanswerDocument[] | null;
selectedDocIndices: number[] | null;
error: string | null;
- queryEventId: number | null;
+ messageId: number | null;
}
export enum SourceCategory {
@@ -116,7 +112,7 @@ export interface SearchRequestArgs {
updateSuggestedSearchType: (searchType: SearchType) => void;
updateSuggestedFlowType: (flowType: FlowType) => void;
updateError: (error: string) => void;
- updateQueryEventId: (queryEventID: number) => void;
+ updateMessageId: (messageId: number) => void;
selectedSearchType: SearchType | null;
}
diff --git a/web/src/lib/search/streamingQa.ts b/web/src/lib/search/streamingQa.ts
index 485d3d1aae..469b578bfa 100644
--- a/web/src/lib/search/streamingQa.ts
+++ b/web/src/lib/search/streamingQa.ts
@@ -1,10 +1,10 @@
+import { BackendMessage } from "@/app/chat/interfaces";
import {
AnswerPiecePacket,
DanswerDocument,
DocumentInfoPacket,
ErrorMessagePacket,
LLMRelevanceFilterPacket,
- QueryEventIdPacket,
Quote,
QuotesInfoPacket,
SearchRequestArgs,
@@ -26,7 +26,7 @@ export const searchRequestStreamed = async ({
updateSuggestedFlowType,
updateSelectedDocIndices,
updateError,
- updateQueryEventId,
+ updateMessageId,
}: SearchRequestArgs) => {
let answer = "";
let quotes: Quote[] | null = null;
@@ -78,7 +78,7 @@ export const searchRequestStreamed = async ({
| QuotesInfoPacket
| DocumentInfoPacket
| LLMRelevanceFilterPacket
- | QueryEventIdPacket
+ | BackendMessage
>(decoder.decode(value, { stream: true }), previousPartialChunk);
if (!completedChunks.length && !partialChunk) {
break;
@@ -150,9 +150,9 @@ export const searchRequestStreamed = async ({
return;
}
- // check for query ID section
- if (Object.hasOwn(chunk, "query_event_id")) {
- updateQueryEventId((chunk as QueryEventIdPacket).query_event_id);
+ // check for message ID section
+ if (Object.hasOwn(chunk, "message_id")) {
+ updateMessageId((chunk as BackendMessage).message_id);
return;
}