chore: modified handleQuestion to favor "Retry" action after a failed response generation

This commit is contained in:
utin-francis-peter 2024-06-07 14:47:29 +01:00
parent f7a1874cb3
commit 0b09c00b50

View File

@ -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) => {