[fix] stream outputs nothing when responses non-event stream
This commit is contained in:
@@ -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>( {
|
||||
|
||||
Reference in New Issue
Block a user