parent
79c4ea053f
commit
aac8d22707
|
@ -24,7 +24,8 @@ export const OpenAIStream = async (model: OpenAIModel, systemPrompt: string, key
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
throw new Error("OpenAI API returned an error");
|
const statusText = res.statusText;
|
||||||
|
throw new Error(`OpenAI API returned an error: ${statusText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
|
|
Loading…
Reference in New Issue