M
MastraAI•2mo ago
Amos

generateVNext with structured output results in undefined object

const result = await agent.generateVNext(inputData.prompt, {
structuredOutput: {
schema: z
.object({
text: z.string().min(1)
})
.array(),
},
});
const result = await agent.generateVNext(inputData.prompt, {
structuredOutput: {
schema: z
.object({
text: z.string().min(1)
})
.array(),
},
});
this results in result.object being typed as undefined. using agent.generate it works fine
3 Replies
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
_roamin_
_roamin_•2mo ago
HI @Iodine & @Amos ! There's already a PR open for this issue, I expect this fix to be available in the next release 😉
_roamin_
_roamin_•2mo ago
the PR if you're curious/want to follow updates: https://github.com/mastra-ai/mastra/pull/7969
GitHub
fix: unify output/structuredOutput types with single OUTPUT g...
Summary This PR consolidates the type system for agent output options, introducing a single OUTPUT generic that works for both the deprecated output option and structuredOutput. Changes Type System...

Did you find this page helpful?