|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIO. - OpenRouter AI > AIO.SetStructOut |
MiniRobotLanguage (MRL)
AIO.SetStructOut|$$FLAG
Enable/Disable Structured JSON Schema Output
Purpose
Enables or disables structured JSON schema output mode. When enabled, the AI model is constrained to generate responses that conform to a specified JSON schema, ensuring predictable and parseable output format for applications that require structured data.
Syntax
AIO.SetStructOut|$$FLAG
Parameters
$$FLAG - A numeric flag to enable or disable structured output:
• 0 - Disable structured output (default)
• 1 - Enable structured JSON schema output
Return Value
None. The setting is stored internally and applied to subsequent API requests.
Example
' Enable structured output mode
AIO.SetStructOut|1
' Define a JSON schema for the response
' (Schema should be set via AIO.SetSchema or similar)
' Request will return valid JSON matching the schema
AIO.Chat|List 3 programming languages|$$Result
Notes
- Requires a JSON schema to be defined for the expected output format
- The model is constrained to produce valid JSON matching the schema
- Useful for extracting structured data from AI responses
- Not all models support structured output mode
- Disabled by default
Related Commands
AIO.SetParTools - Enable/disable parallel tool calling
AIO.Chat - Send chat request
AIO.Init - Initialize AIO system