AI Functions
Functions for asking an AI model about your data.
Ask AI
Asks a chat model a question and returns its answer.
askAi(model, message)
askAi(model, message, systemPrompt)
model- The name or UUID of the Document DocumentTypically refers to an item that can be created in the Explorer Tree, e.g. a Feed, a Pipeline, a Dashboard, etc. May also be known as an Entity.Click to see more details... of typeOpenAIModelto use. The UUID is tried first, so a model whose name happens to be another model’s UUID cannot be used to reach that other model.message- The message to ask the model.systemPrompt- The system prompt to send to the model ahead of the message, for example to tell it what role to play.
Returns the model’s answer, or null if the model had nothing to say.
Where the model cannot be found, or you do not hold the Use permission on it, an error value is returned so that the problem shows in the results rather than looking like an absent value.
The model is asked once per value, so prefer to use this on a grouped or otherwise small set of rows. Repeated identical questions are served from a cache rather than being asked again.
Example
askAi('Event Classifier', concat('Summarise this user agent: ', ${UserAgent}))
> 'A headless Chrome browser, commonly used by automated tooling.'
Last modified October 20, 2026: Merge pull request #144 from gchq/add-7.14-rel-notes (2c6fb22)