|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Model and Endpoint Configuration > AIX. - Grok / X - API |
MiniRobotLanguage (MRL)
AIX.Set Temperature
Set the Temperature Parameter for Response Randomness
Intention
SetTemperature Command: Adjusting Response Creativity
The Set Temperature command allows you to configure the AIX_Temperature parameter, which controls the level of randomness or creativity in Grok’s response generation. This setting influences how deterministic or exploratory the AI’s outputs will be.
It’s part of the AIX - Grok / X - API suite, offering fine-tuned control over AI behavior.
The Set Temperature command sets the AIX_Temperature global variable, a float value typically ranging from 0.0 to 2.0 that adjusts the randomness of Grok’s token selection during response generation.
Lower values (e.g., 0.2) make responses more focused and deterministic, while higher values (e.g., 1.5) increase creativity and variability. If an invalid value is provided, it defaults to 1.0, the standard midpoint setting.
Adjusting the temperature is valuable for:
•Precision: Use low temperatures (e.g., 0.5) for factual or structured responses.
•Creativity: Apply high temperatures (e.g., 1.5) for brainstorming or imaginative tasks.
•Customization: Tailor the AI’s output style to specific use cases or user preferences.
Provide a float value between 0.0 and 2.0 to set the temperature, which is stored in AIX_Temperature and applied to subsequent API requests.
Check the current setting with AIX.Get Temperature to verify the adjustment.
Example Usage
AIX.Set Temperature|0.7
AIX.Ask|Explain quantum physics|0
DBP.Explanation: $$AIX_GrokContent (focused response)
A temperature of 0.7 produces a more concise and predictable explanation.
AIX.Set Temperature|1.8
AIX.Ask|Write a poem|0
DBP.Poem: $$AIX_GrokContent (highly creative output)
A temperature of 1.8 encourages a more imaginative and varied poem.
Illustration
┌───────────────┐
│ Temperature │
├───────────────┤
│ 1.0 │
└───────────────┘
Setting the default temperature for balanced randomness.
Syntax
AIX.SetTemperature[|P1]
AIX.Set Temperature[|P1]
Parameter Explanation
P1 - (Optional) A float value between 0.0 and 2.0 to set the temperature. Values outside this range or omitted default to 1.0.
Example
AIX.Set Temperature|0.3
AIX.Ask|Summarize this text|0
DBP.Summary: $$AIX_GrokContent
ENR.
Remarks
- The temperature setting affects responses in AIX.Ask and AIX.Ask Vision.
- Works alongside parameters like AIX.Set PresencePenalty to shape response characteristics.
Limitations
- Values are clamped to 0.0–2.0; exceeding this range results in the default of 1.0.
- The impact depends on the model’s training and may interact unpredictably with other parameters.
See also:
• AIX.Ask