AIX - Artificial Intelligence and X Platform Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Response Behavior Settings >

AIX - Artificial Intelligence and X Platform Utility

AIX.Get ResponseFormat

Previous Top Next


MiniRobotLanguage (MRL)

 

AIX.Get ResponseFormat
Retrieve the Current Response Format

 

Intention

 

Get ResponseFormat Command: Check Response Structure
 
The Get ResponseFormat command retrieves the current format setting for AI responses, such as text or JSON, as managed within the AIX system.

This allows users to verify how responses are structured.

It’s part of the AIX - Grok / X - API suite.

 

What is the Get ResponseFormat Command?

 

The Get ResponseFormat command returns the current value of the response format setting, likely stored in a global variable (e.g., AIX_ResponseFormat), which defines how the Grok API delivers its output.

Supported formats may include "text" and "json", with "text" as the default unless changed.

 

Why Do You Need It?

 

Retrieving the response format is useful for:

Configuration Verification: Ensures the desired output format is active.

Scripting: Adapts processing logic based on the format (e.g., JSON parsing).

Debugging: Identifies mismatches between expected and actual formats.

 

How to Use the Get ResponseFormat Command?

 

Use the command to retrieve the current response format after setting it with AIX.Set ResponseFormat.

Store the result in a variable to use in conditional logic or display it before executing AIX.Ask or AIX.AskVision.

 

Example Usage

 

AIX.Set ResponseFormat|""json""

AIX.Get ResponseFormat|$$FORMAT

IF $$FORMAT = ""json"" THEN

 DBP.Response format is JSON

ELSE

 DBP.Response format is text

END IF

 

This example sets the response format to JSON, retrieves it, and displays the current setting.

 

Illustration

 

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

│ Response Format    │

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

│ Input: Global Var  │

│ Process: Retrieve  │

│ Output: Format     │

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

A visual of retrieving the current response format setting.

 

Syntax

 

AIX.Get ResponseFormat|$$variable

AIX_Get_ResponseFormat|$$variable

 

Parameter Explanation

 

$$variable - (Required) A variable (e.g., $$FORMAT) of type WSTRING where the current response format (e.g., "text" or "json") will be stored.

 

Remarks

 

- The response format is likely set by AIX.Set ResponseFormat and influences how AIX.Ask and AIX.AskVision format responses.

- The default format is assumed to be "text" unless otherwise specified.

 

Limitations

 

- Reflects only the current setting; does not indicate if the API supports the requested format.

- May return an invalid format if not properly set by AIX.Set ResponseFormat.

 

See also:

 

AIX.Set ResponseFormat

AIX.Ask

AIX.AskVision

Output Formatting and Delivery