mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 20:50:17 +09:00
add temperature config
This commit is contained in:
parent
46c469b2d7
commit
b78e5db817
@ -56,6 +56,7 @@ export function RealtimeChat({
|
|||||||
const [deployment, setDeployment] = useState("");
|
const [deployment, setDeployment] = useState("");
|
||||||
const [useVAD, setUseVAD] = useState(true);
|
const [useVAD, setUseVAD] = useState(true);
|
||||||
const [voice, setVoice] = useState<Voice>("alloy");
|
const [voice, setVoice] = useState<Voice>("alloy");
|
||||||
|
const [temperature, setTemperature] = useState(0.9);
|
||||||
|
|
||||||
const clientRef = useRef<RTClient | null>(null);
|
const clientRef = useRef<RTClient | null>(null);
|
||||||
const audioHandlerRef = useRef<AudioHandler | null>(null);
|
const audioHandlerRef = useRef<AudioHandler | null>(null);
|
||||||
@ -84,7 +85,7 @@ export function RealtimeChat({
|
|||||||
input_audio_transcription: { model: "whisper-1" },
|
input_audio_transcription: { model: "whisper-1" },
|
||||||
turn_detection: turnDetection,
|
turn_detection: turnDetection,
|
||||||
tools: [],
|
tools: [],
|
||||||
temperature: 0.9,
|
temperature,
|
||||||
modalities,
|
modalities,
|
||||||
});
|
});
|
||||||
startResponseListener();
|
startResponseListener();
|
||||||
@ -282,6 +283,14 @@ export function RealtimeChat({
|
|||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// update session params
|
||||||
|
useEffect(() => {
|
||||||
|
clientRef.current?.configure({ voice });
|
||||||
|
}, [voice]);
|
||||||
|
useEffect(() => {
|
||||||
|
clientRef.current?.configure({ temperature });
|
||||||
|
}, [temperature]);
|
||||||
|
|
||||||
const handleClose = async () => {
|
const handleClose = async () => {
|
||||||
onClose?.();
|
onClose?.();
|
||||||
if (isRecording) {
|
if (isRecording) {
|
||||||
|
Loading…
Reference in New Issue
Block a user