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.SetMaxToken

Previous Top Next


MiniRobotLanguage (MRL)

 

AID.Set MaxToken
Set the Maximum Token Limit for DeepSeek API Responses

 

Intention

 

SetMaxToken Command: Control Response Length
 
The SetMaxToken command allows you to define the maximum number of tokens the DeepSeek API can generate in a single response.

This helps manage response length and associated costs effectively.

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

 

What is the SetMaxToken Command?

 

The SetMaxToken command updates the global AID_MaxToken variable, setting the upper limit for tokens in API responses.

If not set or set to 0, it defaults to 1024 tokens.

 

Why Do You Need It?

 

Setting a maximum token limit is crucial for:

Cost Management: Limits output tokens to control API usage costs.

Response Control: Ensures responses are concise and relevant to your needs.

Performance: Prevents overly long responses that may slow down processing.

 

How to Use the SetMaxToken Command?

 

Specify a numeric value for the maximum tokens as the parameter.

DeepSeek models support up to 8000 tokens per response by default, but you can set a lower limit for efficiency.

 

Example Usage

 

AID.Set MaxToken|500

DBP.Max tokens set to 500

 

This limits API responses to 500 tokens, reducing output length and cost.

 

Illustration

 

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

│ MaxToken         │

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

│ 1024 → 500       │

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

Adjusting the maximum token limit from default to a custom value.

 

Syntax

 

AID.SetMaxToken|P1

AID.Set MaxToken|P1

 

Parameter Explanation

 

P1 - A numeric value specifying the maximum number of tokens for API responses. Required.

 

Example

 

AID.Set MaxToken|2000

DBP.Max tokens set to 2000

ENR.

 

Remarks

 

- Defaults to 1024 if not set or if 0 is provided.

- DeepSeek API supports up to 8000 tokens; values above this are capped by the API.

 

Limitations

 

- Must be a positive integer; non-numeric values cause an error.

- Does not affect input token limits, only output.

 

See also:

 

AID.Get MaxToken

AID.Ask

Generation Parameters