|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Session and Storage Management > AIU. - Artificial Intelligence Utility |
MiniRobotLanguage (MRL)
AIU.GetPreviousResponseId
Retrieve the ID of the Previous Response
Intention
GetPreviousResponseId Command: Accessing the Previous Response ID
The GetPreviousResponseId command retrieves the ID of the previous AI response set for operations like AIU.Chat or AIU.Responses.
This allows tracking or verification of response context.
It’s part of the AIU - OpenAI API suite.
This command returns the string ID previously set by AIU.SetPreviousResponseId, or an empty string if unset.
The result can be stored in a variable or pushed onto the Top of Stack (TOS).
Retrieving the previous response ID is useful for:
•Verification: Confirm the ID before further operations.
•Debugging: Log or display the ID for troubleshooting.
•Context Tracking: Ensure the correct response is referenced.
The command accepts an optional variable to store the result; if omitted, the ID is placed on the stack.
It defaults to an empty string unless set by AIU.SetPreviousResponseId.
Example Usage
AIU.SetPreviousResponseId|resp_001
AIU.GetPreviousResponseId|$$RID
DBP.Previous Response ID: $$RID
AIU.GetPreviousResponseId
POP.$$RID
This retrieves the previous response ID into a variable or from the stack after setting it.
Illustration
┌────────────────────────┐
│ Previous Response ID │
├────────────────────────┤
│ resp_001 │
└────────────────────────┘
The ID retrieved for the previous response.
Syntax
AIU.GetPreviousResponseId[|P1]
AIU.Get_PreviousResponseId[|P1]
Parameter Explanation
P1 - (Optional) The variable to store the previous response ID. If omitted, the ID is placed on the Top of Stack (TOS).
Example
AIU.SetPreviousResponseId|chat_456
AIU.GetPreviousResponseId|$$RID
DBP.Previous ID: $$RID
ENR.
Remarks
- Returns an empty string if no ID has been set via AIU.SetPreviousResponseId.
Limitations
- More than one parameter causes an error.
- Does not fetch IDs from the AI server; only reflects locally set values.
See also:
• AIU.Chat