AID. - Artificial Intelligence DeepSeek Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AID. - DeepSeek > !Generation Parameters >

AID. - Artificial Intelligence DeepSeek Utility

AID.SetResponseFormat

Previous Top Next


MiniRobotLanguage (MRL)

 

AID.SetResponseFormat
Set the DeepSeek API Response Format

 

Intention

 

SetResponseFormat Command: Configuring the Response Format
 
The SetResponseFormat command allows you to define the format in which the DeepSeek API returns responses, such as JSON or plain text.

This provides control over how data is structured for further processing in your scripts.

It’s part of the AID - DeepSeek API suite.

 

What is the SetResponseFormat Command?

 

The SetResponseFormat command updates the global AID_RespFormat variable to specify whether the DeepSeek API should return responses in JSON or text format.

By default, it is set to json, but you can change it to text for simpler output.

 

Why Do You Need It?

 

Customizing the response format is crucial for:

Data Processing: JSON format allows structured parsing, while text is ideal for direct display.

Compatibility: Match the format to your script’s requirements or external tools.

Simplicity: Text format reduces overhead for basic queries.

 

How to Use the SetResponseFormat Command?

 

Specify either json or text as the parameter to set the response format for subsequent API calls.

The DeepSeek API supports these formats as of March 2025, with json being the default for structured responses.

 

Example Usage

 

AID.SetResponseFormat|json

DBP.Response format set to JSON

AID.SetResponseFormat|text

DBP.Response format set to plain text

 

This configures the API to return responses in the specified format.

 

Illustration

 

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

│ AID_RespFormat     │

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

│ json / text        │

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

Setting the response format for DeepSeek API calls.

 

Syntax

 

AID.SetResponseFormat|P1

AID.Set_Response_Format|P1

 

Parameter Explanation

 

P1 - The response format to set: json for structured data or text for plain text.

 

Example

 

AID.SetResponseFormat|text

AID.AskT|What is the weather like?|$$RES

DBP.Response: $$RES

ENR.

 

Remarks

 

- The format must be either json or text; other values may cause API errors.

- If no parameter is provided, it defaults to json.

 

Limitations

 

- Only json and text are supported by this implementation.

- No validation is performed on the parameter’s value.

 

See also:

 

AID.Get_Response_Format

AID.Ask

AID.AskT

Response Analysis