Why did the type of GenerateReturn change?
before
after
If output is specified in the generate function, the return type will be GenerateObjectResult and no compile error will occur when accessing response.object.
Why can't I infer text response and object response in this way?
https://github.com/mastra-ai/mastra/pull/5965
I saw this PR, but can't it be a conditional type instead of just an intersection type?
GitHub
streaming v2 by wardpeet · Pull Request #5965 · mastra-ai/mastra
Introducing streamVNext
A new streaming protocol that allows us to stream all mastra primitives, agent, tools, workflows. (soon networks). Our old protocol was based on Vercel's AI sdk data...
5 Replies
My project is giving me tons of compile errors when I update to the latest version.
Please help @Ward
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/6231
Hi @kosukeoya
when output is specified, response.object not throwing any compile error is the correct behaviour as it provides the structured output
can you help with a screenshot of the compile errors your'e seeing? and how you're implementing in code?
https://github.com/mastra-ai/mastra/pull/6185
I forgot to leave the information here.
I created a PR of the fix and it was merged.
GitHub
Fix/generate return types inference by kosukeoya · Pull Request #6...
Description
The GenerateReturn type has been modified in this PR.
#5965
before
export type GenerateReturn<Z extends ZodSchema | JSONSchema7 | undefined = undefined> = Z extends undef...
That's great. Thanks for contributing!