Structured output validation failed (Line break in my json)
Hi,
I'm experiencing a recurring issue when generating JSON. Line breaks aren't being properly escaped: instead of getting \n in my strings, I'm getting actual newline characters that completely break the JSON object structure.
This makes the JSON invalid and impossible to parse.
Here are my agent prompt:
6 Replies
I have this into my generate function :
If anyone has any tips or if I'm doing something wrong
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8973
GitHub
[DISCORD:1428711425517293638] Structured output validation failed (...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1428711425517293638 Hi, I'm experiencing a recurring issue when generating JSON. Line breaks aren'...
Hey @Robin , what version of
@mastra/core
are you on and what model are you using?It would also be helpful to know the prompt, not just the system instructions, so we can reproduce exactly!
It'll help to know which model you're using too - this could be a problem with the model not being great at what you're trying to do, or it could be a bug
Hey, 0.21.0
I do this with mistral-medium latest