|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Tool and Function Management > AIX. - Grok / X - API |
MiniRobotLanguage (MRL)
AIX.Get ToolChoice
Retrieve the Current Tool Choice Setting
Intention
GetToolChoice Command: Checking Tool Preference
The Get ToolChoice command retrieves the current setting for Grok’s tool usage preference, stored in AIX_ToolChoice.
This helps you verify or utilize the tool configuration in your scripts.
It’s part of the AIX - Grok / X - API suite.
The Get ToolChoice command returns the current value of AIX_ToolChoice, which dictates how Grok handles tools in API responses.
Possible values include "none", "auto", "required", or "name":.
Retrieving the tool choice setting is valuable for:
•Verification: Confirm the tool preference before querying Grok.
•Script Logic: Adjust behavior based on the current tool setting.
•Debugging: Ensure the correct tool configuration is applied.
Call the command with an optional variable to store the result.
The default value is "auto" unless changed via AIX.Set ToolChoice.
Example Usage
AIX.Set ToolChoice|"required"
AIX.Get ToolChoice|$$TCH
DBP.Tool Choice: $$TCH
Returns "required", indicating tools are mandatory.
Illustration
┌───────────────┐
│ AIX_ToolChoice│
├───────────────┤
│ "required" │
└───────────────┘
Retrieving the current tool choice setting.
Syntax
AIX.GetToolChoice[|P1]
AIX.Get ToolChoice[|P1]
Parameter Explanation
P1 - (Optional) The variable to store the retrieved tool choice setting. If omitted, the value remains in AIX_ToolChoice.
Example
AIX.Set ToolChoice|"name":"get_weather"
AIX.Get ToolChoice|$$CHO
DBP.Current Tool Choice: $$CHO
ENR.
Remarks
- Default is "auto" unless set by AIX.Set ToolChoice.
- Reflects the configuration used in AIX.Ask requests.
Limitations
- Only retrieves the setting; does not validate tool availability.
- No persistence across sessions without manual saving.
See also:
• AIX.Ask