From 46c469b2d7b95d21c8dc2c4c239c0646f3b43665 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 7 Nov 2024 17:47:55 +0800 Subject: [PATCH] add voice config --- app/components/realtime-chat/realtime-chat.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/components/realtime-chat/realtime-chat.tsx b/app/components/realtime-chat/realtime-chat.tsx index 44dc21de91f..3111f541561 100644 --- a/app/components/realtime-chat/realtime-chat.tsx +++ b/app/components/realtime-chat/realtime-chat.tsx @@ -23,6 +23,7 @@ import { RTInputAudioItem, RTResponse, TurnDetection, + Voice, } from "rt-client"; import { AudioHandler } from "@/app/lib/audio"; import { uploadImage } from "@/app/utils/chat"; @@ -54,6 +55,7 @@ export function RealtimeChat({ const [endpoint, setEndpoint] = useState(""); const [deployment, setDeployment] = useState(""); const [useVAD, setUseVAD] = useState(true); + const [voice, setVoice] = useState("alloy"); const clientRef = useRef(null); const audioHandlerRef = useRef(null); @@ -78,6 +80,7 @@ export function RealtimeChat({ : null; clientRef.current.configure({ instructions: "", + voice, input_audio_transcription: { model: "whisper-1" }, turn_detection: turnDetection, tools: [],