fix: sources not getting set on stream end

This commit is contained in:
Siddhant Rai
2025-06-23 09:23:18 +05:30
parent a9e4583695
commit 709488beb1
2 changed files with 4 additions and 10 deletions

View File

@@ -289,8 +289,7 @@ const ConversationBubble = forwardRef<
type === 'ERROR' ||
sources?.length === 0 ||
sources?.some((source) => source.link === 'None') ? null : !sources &&
chunks !== '0' &&
selectedDocs ? (
chunks !== '0' ? (
<div className="mb-4 flex flex-col flex-wrap items-start self-start lg:flex-nowrap">
<div className="my-2 flex flex-row items-center justify-center gap-3">
<Avatar

View File

@@ -284,14 +284,9 @@ export const conversationSlice = createSlice({
query: Partial<Query>;
}>,
) {
const { conversationId, index, query } = action.payload;
if (state.conversationId !== conversationId) return;
if (!state.queries[index].sources) {
state.queries[index].sources = query?.sources;
} else if (query.sources) {
state.queries[index].sources!.push(...query.sources);
}
const { index, query } = action.payload;
if (query.sources !== undefined)
state.queries[index].sources = query.sources;
},
updateToolCall(state, action) {
const { index, tool_call } = action.payload;