AIG. - AI Google Gemini Integration

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIG. - Google AI > A.Tools-Configuration >

AIG. - AI Google Gemini Integration

AIG.GetToolParamsToArr

Previous Top Next


MiniRobotLanguage (MRL)

 

AIG.GetToolParamsToArr
Bulk Retrieve Function Arguments

 

Intention

 

To extract ALL arguments provided by the AI for a tool call and dump them into an SPR Array. This is useful when you don't know exactly which parameters the AI might send, or if you want to log everything for debugging.

 

What is the GetToolParamsToArr Command?

 

It iterates through every key-value pair in the function's `args` JSON object.

For each parameter, it adds a row to the specified SPR Array in the format:

ParameterName | ParameterValue

 

Why Do You Need It?

 

Dynamic Tools: If you have a generic tool like `update_database(fields...)`, you can loop through whatever fields the AI provides.

Debugging: Quickly see everything the AI is trying to do without guessing parameter names.

 

Example Usage

 

' Assume the AI called: create_user(name="Alice", role="Admin", active=true)

 

' Dump params to Array 20

AIG.GetToolParamsToArr|20

 

' Iterate and print

$$COU=0

:Loop

 ARR.Get|20|$$COU|$$LIN

 IVV.$$LIN=""

 �GTO. Done

 EIF.

 

 ' Split Name and Value

 $$NAM=$$LIN.p1.|

 $$VAL=$$LIN.p2.|

 

 DBP. Param: $$NAM = $$VAL

 

 VIC.$$COU

 GOTO Loop

:Done

 

Syntax

 

AIG.GetToolParamsToArr|P1

AIG.gtpa|P1

 

Parameter Explanation

 

P1 - (Integer) The number of the SPR Array (0-32) to fill.
� �Warning: This command will CLEAR the target array before writing.

 

See also:

 

? AIG.GetToolParam (Single value)

? AIG.GetToolName