|
@@ -644,7 +644,7 @@ export namespace Session {
|
|
|
tools[key] = item
|
|
tools[key] = item
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const result = streamText({
|
|
|
|
|
|
|
+ const stream = streamText({
|
|
|
onError() {},
|
|
onError() {},
|
|
|
maxRetries: 10,
|
|
maxRetries: 10,
|
|
|
maxOutputTokens: outputLimit,
|
|
maxOutputTokens: outputLimit,
|
|
@@ -677,7 +677,8 @@ export namespace Session {
|
|
|
],
|
|
],
|
|
|
}),
|
|
}),
|
|
|
})
|
|
})
|
|
|
- return processStream(assistantMsg, model.info, result)
|
|
|
|
|
|
|
+ const result = await processStream(assistantMsg, model.info, stream)
|
|
|
|
|
+ return result
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function processStream(
|
|
async function processStream(
|
|
@@ -979,7 +980,7 @@ export namespace Session {
|
|
|
}
|
|
}
|
|
|
await updateMessage(next)
|
|
await updateMessage(next)
|
|
|
|
|
|
|
|
- const result = streamText({
|
|
|
|
|
|
|
+ const stream = streamText({
|
|
|
abortSignal: abort.signal,
|
|
abortSignal: abort.signal,
|
|
|
model: model.language,
|
|
model: model.language,
|
|
|
messages: [
|
|
messages: [
|
|
@@ -1002,7 +1003,8 @@ export namespace Session {
|
|
|
],
|
|
],
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- return processStream(next, model.info, result)
|
|
|
|
|
|
|
+ const result = await processStream(next, model.info, stream)
|
|
|
|
|
+ return result
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function lock(sessionID: string) {
|
|
function lock(sessionID: string) {
|