Compare commits

...

3 Commits

Author SHA1 Message Date
raojianb
654787b17b fix: incorrect home page url in header banner 2024-11-19 10:23:33 -08:00
Joby
6fca8b4d42 feat: upgrade the sdk to v2.0.8 (#39) 2024-11-17 22:38:11 -08:00
Joby
431281d47c feat: task mode (#30) 2024-10-22 16:58:38 -07:00
3 changed files with 8 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import type { StartAvatarResponse } from "@heygen/streaming-avatar";
import StreamingAvatar, {
AvatarQuality,
StreamingEvents, TaskType, VoiceEmotion,
StreamingEvents, TaskMode, TaskType, VoiceEmotion,
} from "@heygen/streaming-avatar";
import {
Button,
@@ -97,11 +97,14 @@ export default function InteractiveAvatar() {
emotion: VoiceEmotion.EXCITED,
},
language: language,
disableIdleTimeout: true,
});
setData(res);
// default to voice mode
await avatar.current?.startVoiceChat();
await avatar.current?.startVoiceChat({
useSilencePrompt: false
});
setChatMode("voice_mode");
} catch (error) {
console.error("Error starting avatar session:", error);
@@ -117,7 +120,7 @@ export default function InteractiveAvatar() {
return;
}
// speak({ text: text, task_type: TaskType.REPEAT })
await avatar.current.speak({ text: text }).catch((e) => {
await avatar.current.speak({ text: text, taskType: TaskType.REPEAT, taskMode: TaskMode.SYNC }).catch((e) => {
setDebug(e.message);
});
setIsLoadingRepeat(false);

View File

@@ -28,7 +28,7 @@ export default function NavBar() {
<Link
isExternal
color="foreground"
href="https://app.heygen.com/interactive-avatar"
href="https://labs.heygen.com/interactive-avatar"
>
Avatars
</Link>

View File

@@ -10,7 +10,7 @@
},
"dependencies": {
"@ai-sdk/openai": "^0.0.34",
"@heygen/streaming-avatar": "^2.0.6",
"@heygen/streaming-avatar": "^2.0.8",
"@nextui-org/button": "2.0.34",
"@nextui-org/chip": "^2.0.32",
"@nextui-org/code": "2.0.29",