Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ NOTE: Make sure you have enter your token into the `.env` file and run `npm run

To start your 'session' with a Interactive Avatar, first click the 'start' button. If your HeyGen API key is entered into the Server's .env file, then you should see our demo Interactive Avatar appear.

If you want to see a different Avatar or try a different voice, you can close the session and enter the IDs and then 'start' the session again. Please see below for information on where to retrieve different Avatar and voice IDs that you can use.

### Which Avatars can I use with this project?

By default, there are several Public Avatars that can be used in Interactive Avatar. (AKA Interactive Avatars.) You can find the Avatar IDs for these Public Avatars by navigating to [labs.heygen.com/interactive-avatar](https://labs.heygen.com/interactive-avatar) and clicking 'Select Avatar' and copying the avatar id.

You can create your own custom Interactive Avatars at labs.heygen.com/interactive-avatar by clicking 'create interactive avatar' on the top-left of the screen.
This fork locks the demo to a single avatar, knowledge base and voice. The avatar starts immediately without any configuration UI.

### Where can I read more about enterprise-level usage of the Interactive Avatar API?

Expand Down
14 changes: 0 additions & 14 deletions components/AvatarConfig/Field.tsx

This file was deleted.

192 changes: 0 additions & 192 deletions components/AvatarConfig/index.tsx

This file was deleted.

15 changes: 8 additions & 7 deletions components/InteractiveAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
STTProvider,
ElevenLabsModel,
} from "@heygen/streaming-avatar";
import { useEffect, useRef, useState } from "react";
import { useEffect, useRef } from "react";
import { useMemoizedFn, useUnmount } from "ahooks";

import { Button } from "./Button";
import { AvatarConfig } from "./AvatarConfig";
import { AvatarVideo } from "./AvatarSession/AvatarVideo";
import { useStreamingAvatarSession } from "./logic/useStreamingAvatarSession";
import { AvatarControls } from "./AvatarSession/AvatarControls";
Expand All @@ -20,13 +19,15 @@ import { StreamingAvatarProvider, StreamingAvatarSessionState } from "./logic";
import { LoadingIcon } from "./Icons";
import { MessageHistory } from "./AvatarSession/MessageHistory";

import { AVATARS } from "@/app/lib/constants";
// Pre-configured avatar, knowledge base and voice identifiers

// Default configuration locked to a single avatar, knowledge base and voice
const DEFAULT_CONFIG: StartAvatarRequest = {
quality: AvatarQuality.Low,
avatarName: AVATARS[0].avatar_id,
knowledgeId: undefined,
avatarName: "3fa25b45051a4e3aa6ccc577a53fceab",
knowledgeId: "f724e1cb715c45bd8507e63123338306",
voice: {
voiceId: "59d91d8e7c644cd1a78551a4a45a407f",
rate: 1.5,
emotion: VoiceEmotion.EXCITED,
model: ElevenLabsModel.eleven_flash_v2_5,
Expand All @@ -43,7 +44,7 @@ function InteractiveAvatar() {
useStreamingAvatarSession();
const { startVoiceChat } = useVoiceChat();

const [config, setConfig] = useState<StartAvatarRequest>(DEFAULT_CONFIG);
const config = DEFAULT_CONFIG;

const mediaStream = useRef<HTMLVideoElement>(null);

Expand Down Expand Up @@ -129,7 +130,7 @@ function InteractiveAvatar() {
{sessionState !== StreamingAvatarSessionState.INACTIVE ? (
<AvatarVideo ref={mediaStream} />
) : (
<AvatarConfig config={config} onConfigChange={setConfig} />
<div className="text-white">Ready to start the avatar</div>
)}
</div>
<div className="flex flex-col gap-3 items-center justify-center p-4 border-t border-zinc-700 w-full">
Expand Down