mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-28 11:52:46 +08:00
提升openai接口兼容性
This commit is contained in:
parent
01977ea873
commit
770fd469c7
@ -168,8 +168,8 @@ function parseModelsResponse(response, apiType) {
|
||||
|
||||
// 处理 OpenAI 流式响应
|
||||
async function handleOpenAIStreamResponse(line, onStream) {
|
||||
if (line.startsWith("data: ")) {
|
||||
const jsonStr = line.replace(/^data: /, "");
|
||||
if (line.startsWith("data:")) {
|
||||
const jsonStr = line.replace(/^data:[ ]*/, "");
|
||||
if (jsonStr === "[DONE]") {
|
||||
onStream("", true);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user