|
<< 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 |
MiniRobotLanguage (MRL)
AIG.SetToolChoice
Set How the AI Uses Defined Tools
Intention
Control the mode the AI model operates in regarding the functions (tools) defined via AIG.SetTools. You can specify whether the model can call any function, no functions, must call a function, or must call a specific function.
This Command sets the AIG_ToolChoice global variable. This variable holds the specific string value that corresponds to the `function_calling_config.mode` in the Google API request.
Note: For the Google API, these values act as keywords. You just pass the keyword string.
Valid Modes (Keywords):
�auto (Default): The model decides whether to call a function or respond with text.
�any: The model must call one of the available functions.
�none: The model must not call any function; it will respond with text only.
Use this Command to:
�Ensure Function Execution: Force the AI to call a function when you need structured data or an action performed (use `any`).
�Prevent Function Execution: Guarantee a standard text response even if tools are defined (use `none`).
�Default Behavior: Let the model intelligently decide when to use functions (use `auto` or reset to default).
Simply provide the mode keyword directly. Do not use extra quotes or escape characters; SPR handles the string content literally.
' Force the model to call ANY defined function
AIG.SetToolChoice|any
DBP. Tool choice set to ANY.
' Prevent the model from calling any functions
AIG.SetToolChoice|none
DBP. Tool choice set to NONE.
' Reset to default behavior (auto)
AIG.SetToolChoice|auto
DBP. Tool choice reset to default (auto).
Syntax
AIG.SetToolChoice|P1
AIG.stc|P1
Parameter Explanation
P1 - (Optional) The mode keyword string.
� �- `auto`: Model decides.
� �- `any`: Model forced to use a tool.
� �- `none`: Model forced to use text.
� �- If omitted or empty, resets to `auto`.
Remarks
- This setting is only relevant if tools have been defined using AIG.SetTools.
- Use AIG.GetToolChoice to retrieve the current setting.
See also: