-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs: structured output add more info #11512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughDocumentation updates to the structured output guide expand the "Response format" section into "LLM Structured Output support" with content covering model variations, jsonPromptInjection handling, and two advanced usage patterns: separate structuring models and multi-step approaches with prepareStep. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚨 Redirect Validation FailedThe redirect validation found issues in Action Required: Review and fix the redirect configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/src/content/en/docs/agents/structured-output.mdx (2)
171-171: Remove marketing language from technical explanation.Line 171 uses "built-in support," which reads as marketing copy. Reframe to focus on the technical capability without promotional language.
🔎 Proposed fix
-By default, Mastra passes the schema to the model provider using the `response_format` API parameter. Most model providers have built-in support for this, which reliably enforces the schema. +By default, Mastra passes the schema to the model provider using the `response_format` API parameter. Most model providers support this, which reliably enforces the schema.As per coding guidelines, documentation should avoid adjectives like "built-in" that read like marketing copy.
209-209: Simplify verbose phrasing.The phrase "all of the steps" is unnecessarily wordy.
🔎 Proposed fix
-The main agent will handle all of the steps (including tool calling) and the structured output model will handle only the generation of structured output. +The main agent will handle all the steps (including tool calling) and the structured output model will handle only the generation of structured output.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/src/content/en/docs/agents/structured-output.mdx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{md,mdx}
📄 CodeRabbit inference engine (.cursor/rules/writing-documentation.mdc)
**/*.{md,mdx}: When writing developer documentation, do not use adjectives like 'powerful' or 'built-in' as these read like marketing copy and developers don't like that
When writing developer documentation, do not use 'complete', 'out-of-the-box', 'hands-on', or overly enthusiastic exhortations like 'Check out', 'Learn more', 'Explore'. Do not use words like 'essential' or 'offers'
When writing developer documentation, do not use 'your needs', 'production-ready', 'makes it easy', or 'choose the right...solution' as these are marketing jargon that developers dislike
When writing developer documentation, avoid phrasing like 'without changing your code' or 'automatically handles' that obscures implementation details
In developer documentation, avoid phrasing that glides between benefits without diving into details. Focus on technical specifics and implementation details rather than high-level benefits. For example, avoid sentences like: 'This makes it easy to build AI applications that maintain meaningful conversations and remember important details, whether you're building a simple chatbot or a sophisticated AI assistant'
All H1 headings (# Heading) must use title case format, capitalizing the first letter of each major word. Examples: 'Getting Started', 'Human In-the-Loop Workflow', 'Agent as a Step'
Files:
docs/src/content/en/docs/agents/structured-output.mdx
**/*{docs,documentation}/**/*.{md,mdx}
📄 CodeRabbit inference engine (.windsurfrules)
**/*{docs,documentation}/**/*.{md,mdx}: When writing developer documentation, do not use adjectives like 'powerful' or 'built-in' as they read like marketing copy
When writing developer documentation, do not use words like 'complete', 'out-of-the-box', 'hands-on', or overly enthusiastic exhortations such as 'Check out', 'Learn more', 'Explore', 'essential', or 'offers'
When writing developer documentation, avoid marketing jargon such as 'your needs', 'production-ready', 'makes it easy', or 'choose the right...solution'
When writing developer documentation, do not use phrases like 'without changing your code' or 'automatically handles' as they glide over implementation details
In developer documentation, avoid phrasing that glides between benefits without diving into details; instead, focus on technical nuts and bolts with specific implementation details rather than abstract benefits
Files:
docs/src/content/en/docs/agents/structured-output.mdx
🧠 Learnings (1)
📚 Learning: 2025-11-10T19:12:09.916Z
Learnt from: H2Shami
Repo: mastra-ai/mastra PR: 9944
File: packages/core/src/llm/model/gateways/helicone.ts:85-99
Timestamp: 2025-11-10T19:12:09.916Z
Learning: Helicone AI Gateway has automated normalization mappers that translate provider-specific schemas (including structured outputs) to the destination provider's expected format, making it safe to set supportsStructuredOutputs: true across all providers accessed through Helicone.
Applied to files:
docs/src/content/en/docs/agents/structured-output.mdx
🪛 LanguageTool
docs/src/content/en/docs/agents/structured-output.mdx
[style] ~209-~209: Consider removing “of” to be more concise
Context: ...ured output. The main agent will handle all of the steps (including tool calling) and the ...
(ALL_OF_THE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Validate build outputs
- GitHub Check: Cursor Bugbot
- GitHub Check: test
- GitHub Check: Lint
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
docs/src/content/en/docs/agents/structured-output.mdx (1)
165-249: Documentation expansion is well-structured and technically sound.The new sections clearly explain structured output support variations, jsonPromptInjection handling, and two advanced patterns (separate structuring model and multi-step approach with prepareStep). The code examples are appropriate and illustrate each concept concretely. The Gemini 2.5 note is appropriately contextualized within the broader section.
Note
Expands the structured output docs with provider-specific guidance and advanced usage patterns.
jsonPromptInjectionguidance and example, including a note/workaround for Gemini 2.5 when tools are enabledmodelso a secondary agent generates only the structured outputprepareSteppattern to separate tool calls from structured output generationdocs/src/content/en/docs/agents/structured-output.mdxwith examples and explanations to improve reliability and flexibilityWritten by Cursor Bugbot for commit d80bcea. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.