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

Previous Top Next


MiniRobotLanguage (MRL)

 

AIU.OperatorAddTool
Adds a new tool definition to the current Operator session.

 

Intention

 

The AIU.OperatorAddTool command (aliased as AIU.Oat) allows you to dynamically expand the capabilities of the AI Operator by defining custom tools it can use. After initializing a session with AIU.OperatorBeginSession, you can call this command multiple times to add new functions. Each tool is defined by its name, a description of what it does, and the SPR action to execute when the AI calls it.

 

This command is essential for tailoring the Operator's abilities to your specific automation tasks, enabling it to interact with other systems, perform calculations, or execute custom script logic.

 

Illustration

 

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

│ Tools Array               │

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

│ 1. mouse_click            │

│ 2. type_text              │

│ 3. screenshot             │

│ ... (defaults) ...        │

└──────────────────┬────────┘

                   │ AIU.OperatorAddTool

┌──────────────────▼────────┐

│ 4. get_current_time       │

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

Adding a new custom tool to the Operator's skillset.

 

Syntax

 

AIU.OperatorAddTool|$$TDF

 

Parameter Explanation

 

P1 - $$TDF - (Variable, String, Required)

A single string containing the tool definition, with its parts separated by an asterisk (*). The format is:
"name*description*action_string"
name: The function name the AI will call.
description: A clear explanation for the AI of what the tool does and what its arguments are.
action_string: The SPR command to execute, prefixed with "SUB:" (e.g., "SUB:MyCustomSubroutine").

 

Examples

 

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

' AIU.OperatorAddTool - Sample 1: Add a custom time tool

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

AIU.OperatorBeginSession

 

' Define the new tool in a variable

VAR.$$TDF=get_current_time*Returns the current system time as a string.*SUB:MyTimeSub

 

' Add the tool to the session

AIU.OperatorAddTool|$$TDF

 

MBX.Success:|Tool 'get_current_time' has been added to the Operator session.

END.

 

 

Remarks

 

- The alias AIU.Oat can be used for convenience.

- This command must be called after AIU.OperatorBeginSession, which sets up the internal array where tools are stored.

- The description provided is critical; it is the only information the AI has to understand what your tool does and what arguments it expects. Be descriptive and clear.

 

See also:

 

AIU.OperatorBeginSession

AIU.OperatorRunStep

AIU.OperatorAddResult