|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Response Behavior Settings > AIX. - Artificial Intelligence Extended Utility |
MiniRobotLanguage (MRL)
AIX.SetSeed
Set the Seed Value for Reproducible Responses
Intention
SetSeed Command: Control Response Reproducibility
The SetSeed command sets the seed value in the AIX framework to ensure reproducible responses from the Grok API.
This enables consistent AI outputs for testing or repeated operations.
It’s part of the AIX - Grok / X - API suite.
The SetSeed command assigns a value to the AIX_Seed global variable, which is included in the Grok API JSON payload to control response randomness.
It accepts an optional integer (LONG) parameter; -1 resets to the default (0), and any other value sets the seed directly.
Setting the seed value is useful for:
•Reproducibility: Ensure identical responses for the same prompt across runs.
•Testing: Control randomness for consistent test results.
•Optimization: Fine-tune workflows requiring predictable AI behavior.
Provide an optional integer value to set the seed; use -1 to reset to the default (0).
The seed affects subsequent AIX.Ask or AIX.AskVision calls via the AIX_CreateGrokJSONPayload function. No additional API costs are incurred for setting as of March 18, 2025.
Example Usage
AIX.SetSeed|12345
AIX.Ask|What’s the weather like?|$$RES
DBP.Response: $$RES
Sets the seed to 12345, ensuring the weather response is reproducible.
Illustration
┌──────────────┬────────────────────┐
│ Seed Value │ Effect │
├──────────────┼────────────────────┤
│ 42 │ Fixed response │
├──────────────┼────────────────────┤
│ -1 │ Default (0) │
└──────────────┴────────────────────┘
Illustration of setting seed values and their impact.
Syntax
AIX.SetSeed[|P1]
AIX.Set_Seed[|P1]
Parameter Explanation
P1 - (Optional) The seed value (LONG) to set. Use -1 to reset to the default (0). If omitted, the seed remains unchanged.
Example
AIX.SetSeed|9876
AIX.Ask|Tell me a joke|$$JOK
DBP.Joke: $$JOK
AIX.SetSeed|-1
DBP.Seed reset to default
ENR.
Remarks
- Only included in the API payload if non-default (not 0), as per AIX_CreateGrokJSONPayload.
- Takes effect on the next API call; existing responses are unaffected.
Limitations
- Accepts zero or one parameter; extra parameters may cause an error depending on the interpreter.
- No range validation beyond LONG limits (-2,147,483,648 to 2,147,483,647).
See also:
• AIX.Ask