Skip to content

Commit

Permalink
add voice config
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Nov 7, 2024
1 parent c00ebbe commit 46c469b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/components/realtime-chat/realtime-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
RTInputAudioItem,
RTResponse,
TurnDetection,
Voice,
} from "rt-client";
import { AudioHandler } from "@/app/lib/audio";
import { uploadImage } from "@/app/utils/chat";
Expand Down Expand Up @@ -54,6 +55,7 @@ export function RealtimeChat({
const [endpoint, setEndpoint] = useState("");
const [deployment, setDeployment] = useState("");
const [useVAD, setUseVAD] = useState(true);
const [voice, setVoice] = useState<Voice>("alloy");

const clientRef = useRef<RTClient | null>(null);
const audioHandlerRef = useRef<AudioHandler | null>(null);
Expand All @@ -78,6 +80,7 @@ export function RealtimeChat({
: null;
clientRef.current.configure({
instructions: "",
voice,
input_audio_transcription: { model: "whisper-1" },
turn_detection: turnDetection,
tools: [],
Expand Down

0 comments on commit 46c469b

Please sign in to comment.