AIU. - Artificial Intelligence Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Operator Mode >

AIU. - Artificial Intelligence Utility

AIU.OperatorRunStep

Previous Top Next


MiniRobotLanguage (MRL)

 

AIU.OperatorRunStep
Executes a full 'thinking' step for the Operator.

 

Intention

 

The AIU.OperatorRunStep command (aliased as AIU.ors) is the core engine of the Operator mode. It bundles the entire session context—including the conversation history, available tools, and screen state—into a single request to the AI. The AI then analyzes this context and decides on the next best action(s) to achieve the user's goal. These actions are returned as a list of tool calls in an SPR array.

 

It’s your robot’s brain—AIU.OperatorRunStep takes all the information, thinks, and decides what to do next.

 

Illustration

 

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

│ History, Tools, Screen State│

├─────────────┬───────────────┤

│ AI Engine   │ Actions Array │

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

│ Processes…  │ 1. mouse_click│

│             │ 2. type_text  │

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

The AI processes the session context and returns a list of actions.

 

Syntax

 

AIU.OperatorRunStep|$$ARR

 

Parameter Explanation

 

P1 - $$ARR - (Variable, numeric, Required)

The number of the SPR array where the list of returned actions will be stored. The array will be cleared and populated by this command.

 

Examples

 

'***********************************

' AIU.OperatorRunStep - Sample 1: Main execution loop

'***********************************

' Assume session is initialized with AIU.OperatorBeginSession | 1 | 2 | 3

' Assume history in ARR(3) contains a user request.

 

VAR.$$ACN=4 ' Actions will be stored in ARR(4)

AIU.OperatorRunStep|$$ACN

 

' $$TOS will contain the number of actions returned, or -1 on error.

JIV.$$TOS<0|Lab_failed

JIZ.$$TOS|Lab_NoActions

 

' Loop through the actions in ARR(4) and execute them...

MBX.Ready

END.

 

 

Remarks

 

- This command uses the session arrays configured by AIU.OperatorBeginSession.

- The number of actions returned is placed on the top-of-stack ($$TOS). A value of -1 indicates a critical error.

- If the AI returns a final text answer instead of a tool call, $$TOS will be 1, and the array will contain a single action: "null|speak|The AI's final answer."

- The actions in the output array are formatted as structured strings: "tool_call_id|function_name|json_arguments".

 

See also:

 

AIU.OperatorBeginSession

AIU.OperatorAddTool

AIU.OperatorAddResult