|
|
|
|
@ -215,23 +215,23 @@ export function FreeFlow(){ |
|
|
|
|
setChatWelcome(false); |
|
|
|
|
setChatStatus(ChatStatus.Clear); |
|
|
|
|
break; |
|
|
|
|
// case 'summary': |
|
|
|
|
// console.log('Getting summary...'); |
|
|
|
|
case 'summary': |
|
|
|
|
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_ => { |
|
|
|
|
setChatStatus(ChatStatus.Clear); // Set chat status to Processing |
|
|
|
|
getSummary(history.map(el=>`${el.role}:${el.content}`).join('\n'), data).then(summary_ => { |
|
|
|
|
|
|
|
|
|
// console.log('Summary:', summary_); |
|
|
|
|
// onCueEnd(); // End the current cue after getting summary |
|
|
|
|
console.log('Summary:', summary_); |
|
|
|
|
onCueEnd(); // End the current cue after getting summary |
|
|
|
|
|
|
|
|
|
// setSummary(summary_?.result); |
|
|
|
|
// refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom |
|
|
|
|
setSummary(summary_?.result); |
|
|
|
|
refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom |
|
|
|
|
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
// console.error('Error getting summary:', error); |
|
|
|
|
// }); |
|
|
|
|
}).catch(error => { |
|
|
|
|
console.error('Error getting summary:', error); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// break; |
|
|
|
|
break; |
|
|
|
|
case 'user_input': |
|
|
|
|
setChatStatus(ChatStatus.Message); // Set chat status to User |
|
|
|
|
resetTranscript(); // Reset transcript for user input |
|
|
|
|
@ -306,21 +306,21 @@ export function FreeFlow(){ |
|
|
|
|
sendOsc(OSC_ADDRESS.HINT, ''); // Clear hint message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(cue.callback=='summary') { |
|
|
|
|
console.log('Getting summary...'); |
|
|
|
|
// if(cue.callback=='summary') { |
|
|
|
|
// console.log('Getting summary...'); |
|
|
|
|
|
|
|
|
|
getSummary(history.map(el=>`${el.role}:${el.content}`).join('\n'), data).then(summary_ => { |
|
|
|
|
// getSummary(history.map(el=>`${el.role}:${el.content}`).join('\n'), data).then(summary_ => { |
|
|
|
|
|
|
|
|
|
console.log('Summary:', summary_); |
|
|
|
|
onCueEnd(); // End the current cue after getting summary |
|
|
|
|
// console.log('Summary:', summary_); |
|
|
|
|
// onCueEnd(); // End the current cue after getting summary |
|
|
|
|
|
|
|
|
|
setSummary(summary_?.result); |
|
|
|
|
refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom |
|
|
|
|
// setSummary(summary_?.result); |
|
|
|
|
// refContainer.current.scrollTop = refContainer.current.scrollHeight; // Scroll to bottom |
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
console.error('Error getting summary:', error); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// }).catch(error => { |
|
|
|
|
// console.error('Error getting summary:', error); |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
refAudio.current?.pause(); // Pause any playing audio |
|
|
|
|
console.log('onCueEnd:', cue.id); |
|
|
|
|
|