RegisterAITask

RegisterAITask(taskDescription, prompt): int

Registers a new AI task for asynchronous processing.

Table 1. Parameters

taskDescription

String

Description of the AI task

prompt

String

Prompt to send to the AI assistant

Return

Integer task ID which can be used to track the task’s execution and retrieve results.

Use this function for long-running AI operations where you don’t need an immediate response. For synchronous AI queries, use QueryAIAssistant.

// Register an AI task for later processing
taskId = RegisterAITask("Analyze alarm patterns", "Review recent alarms and identify patterns");
println("Registered AI task with ID: " .. taskId);