Skip to content

Commit 46c469b

Browse files
committed
add voice config
1 parent c00ebbe commit 46c469b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/components/realtime-chat/realtime-chat.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
RTInputAudioItem,
2424
RTResponse,
2525
TurnDetection,
26+
Voice,
2627
} from "rt-client";
2728
import { AudioHandler } from "@/app/lib/audio";
2829
import { uploadImage } from "@/app/utils/chat";
@@ -54,6 +55,7 @@ export function RealtimeChat({
5455
const [endpoint, setEndpoint] = useState("");
5556
const [deployment, setDeployment] = useState("");
5657
const [useVAD, setUseVAD] = useState(true);
58+
const [voice, setVoice] = useState<Voice>("alloy");
5759

5860
const clientRef = useRef<RTClient | null>(null);
5961
const audioHandlerRef = useRef<AudioHandler | null>(null);
@@ -78,6 +80,7 @@ export function RealtimeChat({
7880
: null;
7981
clientRef.current.configure({
8082
instructions: "",
83+
voice,
8184
input_audio_transcription: { model: "whisper-1" },
8285
turn_detection: turnDetection,
8386
tools: [],

0 commit comments

Comments
 (0)