diff --git a/.gitignore b/.gitignore index 8f322f0..9e8dccd 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts +.idea diff --git a/components/StreamingAvatar.tsx b/components/StreamingAvatar.tsx index c5f6b65..f234122 100644 --- a/components/StreamingAvatar.tsx +++ b/components/StreamingAvatar.tsx @@ -131,6 +131,16 @@ export default function StreamingAvatar() { setInitialized(true); } + async function handleInterrupt() { + if (!initialized || !avatar.current) { + setDebug('Avatar API not initialized'); + return; + } + await avatar.current.interrupt({ interruptRequest: { sessionId: data?.sessionId } }).catch((e) => { + setDebug(e.message); + }); + } + async function endSession() { if (!initialized || !avatar.current) { setDebug("Avatar API not initialized"); @@ -249,6 +259,14 @@ export default function StreamingAvatar() { > +