mirror of
https://github.com/LLM-Red-Team/kimi-free-api.git
synced 2025-04-18 09:29:12 +08:00
fix error for stream output
This commit is contained in:
parent
8019add607
commit
c5c92b2e16
@ -951,6 +951,7 @@ function createTransStream(model: string, convId: string, stream: any, endCallba
|
||||
const created = util.unixTimestamp();
|
||||
// 创建转换流
|
||||
logger.info('createTransStream start')
|
||||
let thinking = false
|
||||
const transStream = new PassThrough();
|
||||
let webSearchCount = 0;
|
||||
let searchFlag = false;
|
||||
@ -969,7 +970,7 @@ function createTransStream(model: string, convId: string, stream: any, endCallba
|
||||
})}\n\n`);
|
||||
const parser = createParser(event => {
|
||||
try {
|
||||
let thinking = false
|
||||
|
||||
if (event.type !== "event") return;
|
||||
// 解析JSON
|
||||
const result = _.attempt(() => JSON.parse(event.data));
|
||||
|
Loading…
x
Reference in New Issue
Block a user