[fix] stream outputs nothing when responses non-event stream

This commit is contained in:
kwaroran
2023-06-21 23:41:03 +09:00
parent e0f88c93e3
commit 2bc96514fc

View File

@@ -183,6 +183,13 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
}
}
if(da.headers.get('Content-Type') !== 'text/event-stream'){
return {
type: "fail",
result: await da.text()
}
}
let dataUint = new Uint8Array([])
const transtream = new TransformStream<Uint8Array, string>( {