diff --git a/vite/src/pages/flow_free.jsx b/vite/src/pages/flow_free.jsx index 6e45f4e..aae9628 100644 --- a/vite/src/pages/flow_free.jsx +++ b/vite/src/pages/flow_free.jsx @@ -242,18 +242,21 @@ export function FreeFlow(){ console.log('Getting summary...'); setChatStatus(ChatStatus.Clear); // Set chat status to Processing - getSummary(history.map(el=>`${el.role}:${el.content}`).join('\n'), data).then(summary_ => { + + let message=refInput.current?.value?.trim() || history.map(el=>`${el.role}:${el.content}`).join('\n'); + getSummary(message, data).then(summary_ => { console.log('Summary:', summary_); onCueEnd(); // End the current cue after getting summary - setSummary(summary_?.result); + setSummary(()=>summary_?.result); refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom }).catch(error => { console.error('Error getting summary:', error); }); + break; case 'user_input': setChatStatus(ChatStatus.Message); // Set chat status to User