This guide focuses specifically on the Validated Output, with practical examples ranging from basic usage to advanced scenarios.
Understanding the Problem
Traditional LLM interactions often look like this:Python
- LLMs often fail to consistently satisfy all the individual requirements outlined in the promp
- There is no visibility into which requirements were not met
- Manual trial-and-error to get desired output
How AI21 Maestro Works
Maestro’s instruction following enhancer uses a Generate → Validate → Fix cycle:- Generate: Creates initial response following your requirements
- Validate: Evaluates and scores each requirement (0.0 to 1.0)
- Fix: Refines output for requirements that scored < 1.0
- Repeat: Continues until all requirements are met or budget is exhausted
text
Using the API
The Input parameter You can pass a string to Maestro as an input and it will be treated as a user message.Python
Python
Working with Requirements
Writing Effective Requirements
Good Requirements:Python
Python
Requirement Categories
Format Requirements:Python
Python
Python
Python
Requirements Report
Enable detailed reporting by including requirements_result:Python
Python
- 2 out of 3 requirements were perfectly met
- The rating requirement needs refinement
- You might need a higher budget or clearer requirement
Budget Control and Performance
Budget Levels ExplainedPython
Using Third-Party Models
Python