-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Labels
Description
To Reproduce
try {
let r;
if (streamingCallback) {
const {response, stream} = await generateStream(
generateOptions
)
for await (const chunk of stream()) {
const fContent = chunk.content
const buildChunk = {
name: undefined,
done: false,
result: {
response: fContent.at(-1)
}
}
console.log("-🤖- ", JSON.stringify(buildChunk), "\n")
streamingCallback(buildChunk)
}
r = await response()
} else {
r = await generate(generateOptions)
}
return r.toJSON()
} catch (e) {
return {
error: (e as Error).message
}
}Expected behavior
- try catch can be catch error normally
Runtime:
- OS: MacOS
- Version: 15.0 Beta (24A5327a)
** Node version **
v20.13.1
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
