QueryAIAssistant

QueryAIAssistant(prompt, context): String

Sends a prompt to the AI assistant and returns the response.

Table 1. Parameters

prompt

String

Prompt to send to the AI assistant

context

NetObj

Optional context object to provide additional information to the AI

Return

String containing the AI assistant’s response, or NULL on failure.

// Query AI without context
response = QueryAIAssistant("Analyze this network situation");
println(response);

// Query AI with node context
response = QueryAIAssistant("What might be causing high CPU usage?", $node);
println(response);

This function blocks until the AI responds. For long-running or background AI operations, use RegisterAITask.