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