AIX. - Grok / X - API

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Setup and Configuration >

AIX. - Grok / X - API

AIX.SetUser

Previous Top Next


MiniRobotLanguage (MRL)

 

AIX.Set User
Set the User Identifier for the Session

 

Intention

 

SetUser Command: Assigning a User Identifier
 
The Set User command allows you to specify a user identifier for the current session, which can be sent with API requests to Grok.

This helps track or personalize interactions with the AI.

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

 

What is the SetUser Command?

 

The Set User command assigns a value to the AIX_User global variable, used in API payloads to identify the user.

If no identifier is provided, it resets to an empty string.

 

Why Do You Need It?

 

Setting a user identifier is beneficial for:

Tracking: Associate API requests with a specific user or session.

Personalization: Enable Grok to tailor responses based on user context.

Debugging: Identify which user generated a specific request or response.

 

How to Use the SetUser Command?

 

Pass a string as the user identifier, or omit it to clear the current value.

The identifier is stored in AIX_User and included in subsequent API requests.

 

Example Usage

 

AIX.Set User|john_doe_123

DBP.User set to: john_doe_123

AIX.Set User

 

The second call resets AIX_User to an empty string.

 

Illustration

 

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

│ User ID       │

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

│ john_doe_123  │

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

Setting a user identifier for the session.

 

Syntax

 

AIX.SetUser[|P1]

AIX.Set User[|P1]

 

Parameter Explanation

 

P1 - (Optional) The user identifier string to set. If omitted, resets to an empty string.

 

Example

 

AIX.Set User|user_456

DBP.User ID: user_456

ENR.

 

Remarks

 

- The identifier is trimmed of leading/trailing whitespace.

- Included in API payloads if non-empty; see AIX.Ask.

 

Limitations

 

- No validation on the identifier’s format or length.

- Effect depends on Grok API’s support for the user field.

 

See also:

 

AIX.Get User

AIX.Ask

AIX.Ask Vision

AIX.Set Key