AI Object
 
Syntax
 
lValue = AI.CurrentAdmin
AI.CurrentAdmin = lAdmin
 
Type
Long
Access
read/write
Description
Gets or sets the administration number (Admin) that will be used as context for the next call to Ask. When running from an interactive Tradium client, the property is initialized from the active administration. When running from a server-side host such as the MacroHandler or AdminMailMain, no interactive administration context exists and the property defaults to 0.
 
A macro should explicitly set this property before calling Ask whenever it needs the AI's answer to be evaluated within a specific administration — for example when the prompt references data, ledger accounts, or product codes that exist per administration. The value is sent along to the server with each Ask call and is also recorded in the resulting queue entry.
 
See Also
Example
 
Sub Main
Dim hConv As Long
Dim lAdminBackup As Long
 
lAdminBackup = AI.CurrentAdmin
AI.CurrentAdmin = 2 'switch to admin 2 for this call
hConv = AI.Ask("List the top 5 customers by revenue this year.", aiSQLCopilot)
 
AI.CurrentAdmin = lAdminBackup 'restore
End Sub