|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIO. - OpenRouter AI > AIO.SetTopLogprobs |
MiniRobotLanguage (MRL)
AIO.SetTopLogprobs|$$NUM
Set Number of Top Logprobs to Return
Purpose
Specifies how many top token log probabilities to return for each generated token. When logprobs are enabled via AIO.SetLogprobs, this setting controls how many alternative token candidates are included in the response, allowing analysis of the model's top choices at each step.
Syntax
AIO.SetTopLogprobs|$$NUM
Parameters
$$NUM - The number of top log probabilities to return for each token. Valid range is 0 to 20. Set to 0 to disable top logprobs output (only the selected token's logprob will be returned).
Return Value
None. The setting is stored internally and applied to subsequent API requests when logprobs are enabled.
Example
' Enable log probabilities first
AIO.SetLogprobs|1
' Request top 5 alternative tokens for each position
AIO.SetTopLogprobs|5
' Send request - response will include logprobs data
AIO.Chat|Translate hello to French|$$Result
' Get 20 top candidates (maximum) for detailed analysis
AIO.SetTopLogprobs|20
Notes
- Valid range: 0 to 20 (values outside this range may be clamped)
- Only takes effect when AIO.SetLogprobs|1 has been called
- Higher values increase response size and processing time
- Useful for debugging, analyzing model behavior, and alternative generation
- Returns to default (0) when AIO.Init is called
Related Commands
AIO.SetLogprobs - Enable/disable log probabilities
AIO.Chat - Send chat request
AIO.Init - Initialize AIO system