|
|
|
@ -243,18 +243,21 @@ export function FreeFlow(){ |
|
|
|
console.log('Getting summary...'); |
|
|
|
console.log('Getting summary...'); |
|
|
|
|
|
|
|
|
|
|
|
setChatStatus(ChatStatus.Clear); // Set chat status to Processing |
|
|
|
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_); |
|
|
|
console.log('Summary:', summary_); |
|
|
|
onCueEnd(); // End the current cue after getting summary |
|
|
|
onCueEnd(); // End the current cue after getting summary |
|
|
|
|
|
|
|
|
|
|
|
setSummary(summary_?.result); |
|
|
|
setSummary(()=>summary_?.result); |
|
|
|
refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom |
|
|
|
refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
|
console.error('Error getting summary:', error); |
|
|
|
console.error('Error getting summary:', error); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'user_input': |
|
|
|
case 'user_input': |
|
|
|
setChatStatus(ChatStatus.Message); // Set chat status to User |
|
|
|
setChatStatus(ChatStatus.Message); // Set chat status to User |
|
|
|
|