Skip to content

Commit 770bbbf

Browse files
committed
fix: register callbacks before simli client initailization
1 parent 4ef7779 commit 770bbbf

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

app/SimliOpenAI.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import cn from "./utils/TailwindMergeAndClsx";
77

88
interface SimliOpenAIProps {
99
simli_faceid: string;
10-
openai_voice: "alloy"|"ash"|"ballad"|"coral"|"echo"|"sage"|"shimmer"|"verse";
10+
openai_voice: "alloy" | "ash" | "ballad" | "coral" | "echo" | "sage" | "shimmer" | "verse";
1111
openai_model: string;
1212
initialPrompt: string;
1313
onStart: () => void;
@@ -103,7 +103,7 @@ const SimliOpenAI: React.FC<SimliOpenAIProps> = ({
103103
);
104104
// openAIClientRef.current.on('response.canceled', handleResponseCanceled);
105105

106-
106+
107107
await openAIClientRef.current.connect().then(() => {
108108
console.log("OpenAI Client connected successfully");
109109
openAIClientRef.current?.createResponse();
@@ -354,8 +354,8 @@ const SimliOpenAI: React.FC<SimliOpenAIProps> = ({
354354
try {
355355
console.log("Starting...");
356356
initializeSimliClient();
357-
await simliClient?.start();
358357
eventListenerSimli();
358+
await simliClient?.start();
359359
} catch (error: any) {
360360
console.error("Error starting interaction:", error);
361361
setError(`Error starting interaction: ${error.message}`);
@@ -409,9 +409,8 @@ const SimliOpenAI: React.FC<SimliOpenAIProps> = ({
409409
return (
410410
<>
411411
<div
412-
className={`transition-all duration-300 ${
413-
showDottedFace ? "h-0 overflow-hidden" : "h-auto"
414-
}`}
412+
className={`transition-all duration-300 ${showDottedFace ? "h-0 overflow-hidden" : "h-auto"
413+
}`}
415414
>
416415
<VideoBox video={videoRef} audio={audioRef} />
417416
</div>

app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import GitHubLogo from "@/media/github-mark-white.svg";
99

1010
interface avatarSettings {
1111
name: string;
12-
openai_voice: "alloy"|"ash"|"ballad"|"coral"|"echo"|"sage"|"shimmer"|"verse";
12+
openai_voice: "alloy" | "ash" | "ballad" | "coral" | "echo" | "sage" | "shimmer" | "verse";
1313
openai_model: string;
1414
simli_faceid: string;
1515
initialPrompt: string;

0 commit comments

Comments
 (0)