const handleUpload = async () => {
const audioBlob = new Blob(audioChunks, { type: "audio/webm" });
const formData = {
file:audioBlob,
model:"whisper-1"
}
fetch("https://api.openai.com/v1/audio/transcriptions", {
method: "POST",
headers: {
"Content-Type": "audio/webm",
Authorization: `Bearer REDACTED_OPENAIKEY`,
},
body:formData,
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
};
我提供了返回错误的型号名称 有讯息
error:{message:"you must provide a model parameter"}