|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIO. - OpenRouter AI > AIO.SetModelsArr |
MiniRobotLanguage (MRL)
AIO.SetModelsArr|`JSON
Set Model Fallbacks Array
Purpose
Sets a model fallbacks array for automatic fallback when the primary model is unavailable or fails. This enables resilient AI operations by specifying backup models to try in sequence.
Syntax
AIO.SetModelsArr|`JSON
Parameters
`JSON - A JSON array string containing model identifiers in priority order. The system will attempt each model in sequence if the previous one fails.
JSON Format
["openai/gpt-4o","anthropic/claude-3-sonnet","google/gemini-pro"]
Notes
- Models are tried in the order specified in the array
- Fallback occurs on model errors, timeouts, or rate limits
- Each model in the list must be accessible with your API key
- Cleared when AIO.Init is called
Example
' Set fallback models for reliability
AIO.SetModelsArr|["openai/gpt-4o-mini","anthropic/claude-3-haiku"]
' Chat will try primary first, then fallbacks
AIO.Chat|Hello|`Response
Related Commands
AIO.SetModel - Set primary model
AIO.Chat - Send chat request