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.Set ResponseFormat

Previous Top Next


MiniRobotLanguage (MRL)

 

AIX.Set ResponseFormat
Set the Format for AI Responses (e.g., text, JSON)

 

Intention

 

Set ResponseFormat Command: Configure Output Structure
 
The Set ResponseFormat command configures the format of AI responses, such as "text" or "json", to be used by the Grok API.

This customizes how responses are delivered for AIX.Ask and AIX.AskVision.

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

 

What is the Set ResponseFormat Command?

 

The Set ResponseFormat command updates a global setting (e.g., AIX_ResponseFormat) to specify the desired response format.

Supported formats include "text" for plain text and "json" for structured data, with "text" as the default.

 

Why Do You Need It?

 

Setting the response format is valuable for:

Customization: Tailors output to user or application needs.

Data Processing: Enables JSON parsing for structured data use.

Compatibility: Ensures responses match expected formats.

 

How to Use the Set ResponseFormat Command?

 

Use the command to set the response format before executing AI queries with AIX.Ask or AIX.AskVision.

Specify the format (e.g., "text" or "json") and verify with AIX.Get ResponseFormat.

 

Example Usage

 

AIX.Set ResponseFormat|""json""

AIX.Ask|""Provide weather data""

AIX.Get ResponseFormat|$$FORMAT

DBP.Response format: $$FORMAT

AIX.Set ResponseFormat|""text""

AIX.Ask|""Tell me a story""

 

This example sets the format to JSON for a data query, verifies it, then switches to text for a narrative query.

 

Illustration

 

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

│ Set Response Format│

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

│ Input: Format      │

│ Process: Update    │

│ Output: Setting    │

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

A visual of setting and updating the response format configuration.

 

Syntax

 

AIX.Set ResponseFormat|format

AIX_Set_ResponseFormat|format

 

Parameter Explanation

 

format - (Required) A string (e.g., "text" or "json") specifying the desired response format.

 

Remarks

 

- The format setting is applied to subsequent calls to AIX.Ask and AIX.AskVision, assuming the Grok API supports the specified format.

- The default format is "text" if not explicitly set.

 

Limitations

 

- Changes apply only to future responses; existing responses retain their original format.

- Unsupported formats may be ignored or cause errors if the API does not accommodate them.

 

See also:

 

AIX.Get ResponseFormat

AIX.Ask

AIX.AskVision

Output Formatting and Delivery