AIU. - Artificial Intelligence Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Response Behavior Settings >

AIU. - Artificial Intelligence Utility

AIU.SetTemperature

Previous Top Next


MiniRobotLanguage (MRL)

 

AIU.SetTemperature
Set the Temperature for Response Randomness

 

Intention

 

SetTemperature Command: Control Response Creativity
 
The SetTemperature command adjusts the temperature parameter, which controls the randomness of AI responses in operations like chat or embeddings generation.

This allows you to fine-tune how creative or deterministic the AI’s output will be.

It’s part of the AIU - OpenAI API suite.

 

What is the SetTemperature Command?

 

The SetTemperature command sets the temperature value used by the AI model, influencing the diversity of its responses.

A lower value (e.g., 0.2) makes responses more focused and predictable, while a higher value (e.g., 1.0) increases creativity and variability.

 

Why Do You Need It?

 

Adjusting the temperature is crucial for:

Precision: Lower settings ensure consistent, factual responses for tasks like data analysis.

Creativity: Higher settings generate diverse, imaginative outputs for creative writing or brainstorming.

Customization: Tailor the AI’s behavior to suit specific use cases.

 

How to Use the SetTemperature Command?

 

Provide a numeric value (typically between 0 and 2) as the parameter to set the temperature.

This setting applies to subsequent AI operations like AIU.Chat or AIU.Embed.

Available models and their prices (as of March 18, 2025, from OpenAI’s pricing page) include:

gpt-4o: $5.00/1M input tokens, $15.00/1M output tokens (multimodal, 128K context).

gpt-4o-mini: $0.15/1M input tokens, $0.60/1M output tokens (cost-effective, 128K context).

gpt-4-turbo: $10.00/1M input tokens, $30.00/1M output tokens (high performance, 128K context).

gpt-3.5-turbo: $0.50/1M input tokens, $1.50/1M output tokens (dialog-optimized, 16K context).

o1-preview: $15.00/1M input tokens, $60.00/1M output tokens (advanced reasoning, 128K context).

o1-mini: $3.00/1M input tokens, $12.00/1M output tokens (reasoning, cost-effective, 128K context).

 

Example Usage

 

AIU.SetTemperature|0.7

AIU.Chat|What is the weather like today?|$$RES

DBP.Response: $$RES

 

Sets the temperature to 0.7 for a balanced mix of creativity and coherence in the chat response.

 

Illustration

 

┌────────────────────┐

│ Temperature Input  │

├────────────────────┤

│ 0.7                │

├────────────────────┤

│ Effect             │

├────────────────────┤

│ Balanced Output    │

└────────────────────┘

Illustration of setting temperature to 0.7 for balanced AI responses.

 

Syntax

 

AIU.SetTemperature|P1

AIU.Set_Temperature|P1

 

Parameter Explanation

 

P1 - A numeric value (e.g., 0 to 2) specifying the temperature. Required.

 

Example

 

AIU.SetTemperature|1.0

AIU.Chat|Tell me a story|$$STO

DBP.Creative Story: $$STO

ENR.

 

Remarks

 

- Temperature typically ranges from 0 to 2, though exact limits depend on the AI model.

- This setting persists until changed or the script ends.

 

Limitations

 

- Requires exactly one parameter; omitting or adding extra parameters causes an error.

- Does not validate if the value is within the model’s supported range.

 

See also:

 

AIU.Get_Temperature

AIU.Chat

Temperature Configuration