From 0b09c00b50edc437b4011d5c058418a97394eef8 Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Fri, 7 Jun 2024 14:47:29 +0100 Subject: [PATCH] chore: modified handleQuestion to favor "Retry" action after a failed response generation --- frontend/src/conversation/Conversation.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index cf4949e..1bddf2e 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -80,11 +80,11 @@ export default function Conversation() { }); }; - const handleQuestion = (question: string) => { + const handleQuestion = (question: string, isRetry = false) => { question = question.trim(); if (question === '') return; setEventInterrupt(false); - dispatch(addQuery({ prompt: question })); + !isRetry && dispatch(addQuery({ prompt: question })); //dispatch only new queries fetchStream.current = dispatch(fetchAnswer({ question })); }; const handleFeedback = (query: Query, feedback: FEEDBACK, index: number) => {