Skip to main content
Back to Library
Prompt Engineering Guide

Mastering JSON schema generation
on Mistral Large 2

Stop guessing. See how professional prompt engineering transforms Mistral Large 2's output for specific technical tasks.

The "Vibe" Prompt

"Generate a JSON schema that describes data related to a blog post, including title, content, author, publication date, tags, and comments. Comments should have an author and text."
Low specificity, inconsistent output

Optimized Version

STABLE
The user requires a JSON schema for a 'blog post' entity. **Schema Requirements Breakdown:** 1. **Root Object:** Represents a single blog post. 2. **Required Properties (Blog Post):** * `title`: string, descriptive header. * `content`: string, the main body of the post. * `author`: string, name of the post's writer. * `publicationDate`: string, date in 'YYYY-MM-DD' format. 3. **Optional Properties (Blog Post):** * `tags`: array of strings, keywords associated with the post. * `comments`: array of objects, user feedback on the post. 4. **Comment Object Structure (if `comments` array is present):** * **Required Properties (Comment):** * `author`: string, name of the commenter. * `text`: string, the comment content. **Constraint:** Ensure all string types are clearly defined, arrays have `items` defined, and the overall schema is valid JSON Schema Draft 7 or later.
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt uses a chain-of-thought structure, breaking down the request into logical, numbered steps. It explicitly defines the root object, distinguishes between required and optional properties, and provides detailed sub-schema definitions (like for 'comments'). It also specifies data types (e.g., 'string', 'array of objects') and format expectations ('YYYY-MM-DD'). This detailed breakdown reduces ambiguity, guides the model to produce a more precise and complete schema, minimizes misinterpretations, and implicitly encourages the model to think through each component.

0%
Token Efficiency Gain
The optimized prompt explicitly defines property types for all fields.
The optimized prompt clearly separates required and optional fields.
The optimized prompt specifies the format for 'publicationDate'.

Ready to stop burning tokens?

Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.

Optimize My Prompts