AIX. - Artificial Intelligence Extended Utility

<< 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

AIX.GetSeed

Previous Top Next


MiniRobotLanguage (MRL)

 

AIX.GetSeed
Retrieve the Current Seed Value

 

Intention

 

GetSeed Command: Retrieve Seed for Reproducible Responses
 
The GetSeed command retrieves the current seed value used by the AIX framework to ensure reproducible responses from the Grok API.

This allows users to verify or reuse the seed for consistent AI behavior.

It’s part of the AIX - Grok / X - API suite.

 

What is the GetSeed Command?

 

The GetSeed command fetches the current value of the AIX_Seed global variable, which controls the randomness seed for Grok API chat completions.

The seed is an integer (LONG) value, defaulting to 0 if not set, and can be stored in an optional variable or pushed to the Top of Stack (TOS).

 

Why Do You Need It?

 

Retrieving the seed value is valuable for:

Consistency: Verify the seed used for reproducible AI responses.

Debugging: Check or log the seed to troubleshoot response variations.

Reuse: Retrieve the seed to replicate results in future calls.

 

How to Use the GetSeed Command?

 

Call the command with an optional variable to store the seed value; if omitted, it’s pushed to the stack.

The seed affects responses from AIX.Ask or AIX.AskVision when set via AIX.SetSeed. No additional API costs are incurred for retrieval as of March 18, 2025.

 

Example Usage

 

AIX.SetSeed|42

AIX.GetSeed|$$SEE

DBP.Current Seed: $$SEE

 

Sets the seed to 42 and retrieves it into $$SEE, displaying "Current Seed: 42".

 

Illustration

 

┌──────────────┬──────────────┐

│ Seed Set     │ Retrieved    │

├──────────────┼──────────────┤

│ 42           │ 42           │

├──────────────┼──────────────┤

│ (default)    │ 0            │

└──────────────┴──────────────┘

Illustration of seed retrieval after setting or default state.

 

Syntax

 

AIX.GetSeed[|P1]

AIX.Get_Seed[|P1]

 

Parameter Explanation

 

P1 - (Optional) The variable where the seed value (LONG) is stored. If omitted, the value is placed on the Top of Stack (TOS).

 

Example

 

AIX.GetSeed|$$VAL

DBP.Seed Value: $$VAL

AIX.GetSeed

POP.$$STA

DBP.Seed from Stack: $$STA

ENR.

 

Remarks

 

- Defaults to 0 if not explicitly set via AIX.SetSeed.

- The seed influences the randomness of Grok API responses when included in the JSON payload.

 

Limitations

 

- Accepts zero or one parameter; extra parameters may cause an error depending on the interpreter.

- Only retrieves the current seed, not historical values.

 

See also:

 

AIX.Set_Seed

AIX.Ask

AIX.Ask_Vision

AIX.Get_Content