fix(conv): /search after setting id

This commit is contained in:
ManishMadan2882
2024-09-20 02:59:15 +05:30
parent 63a15a3359
commit bf7cce52db
2 changed files with 18 additions and 1 deletions

View File

@@ -246,7 +246,7 @@ export default function Conversation() {
)}
{queries.length > 0 ? (
<div className="w-full md:w-8/12 px-1">
<div className="w-full md:w-8/12">
{queries.map((query, index) => {
return (
<Fragment key={index}>

View File

@@ -72,6 +72,23 @@ export const fetchAnswer = createAsyncThunk<Answer, { question: string }>(
query: { conversationId: data.id },
}),
);
handleSearch(
//search for sources post streaming
question,
state.preference.selectedDocs!,
state.conversation.conversationId,
state.conversation.queries,
state.preference.chunks,
state.preference.token_limit,
).then((sources) => {
//dispatch streaming sources
dispatch(
updateStreamingSource({
index: state.conversation.queries.length - 1,
query: { sources: sources ?? [] },
}),
);
});
} else if (data.type === 'error') {
// set status to 'failed'
dispatch(conversationSlice.actions.setStatus('failed'));