Help Centre › Functions & Formulas
For a full list of available calculation functions, please read What calculation functions are supported.
This article describes the formula syntax and usage of the AI function.
Description
The AI function allows you to integrate AI capabilities into your Automize calculations and processes. You can use it to generate text, summarize content, translate languages, and more, leveraging the power of AI directly within your automation workflows.
Syntax
AI(prompt, [model], [temperature], [max_tokens])
The AI function syntax has the following arguments:
- prompt - Required. The text prompt or instruction you want to send to the AI model.
- model - Optional. The AI model to use (e.g., "gpt-4"). If not specified, the default model will be used.
- temperature - Optional. A value between 0 and 1 that controls the randomness of the output. Higher values produce more random results.
- max_tokens - Optional. The maximum number of tokens to generate in the response.
Example
| Formula | Description | Result |
| =AI("Summarize the following text: 'Automize is a powerful automation platform.'", "gpt-4", 0.5, 50) | Generates a summary of the provided text using the GPT-4 model. | "Automize is a robust platform for creating automated workflows." |
| =AI("Translate 'Hello, world!' to Spanish", "gpt-4", 0.3, 20) | Translates the given text into Spanish using the GPT-4 model. | "¡Hola, mundo!" |
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Prompt | Yes | Text (multi-line) | – | The AI instruction or question to process. |
| Variable | Yes | Text | – | Variable to store the AI response. |
Output variables
| Variable | Type | Description |
|---|---|---|
| Variable | Text | The AI-generated response. |
Errors
| Error | Description |
|---|---|
| AI service unavailable | The AI service could not be reached. |
| Invalid prompt | The prompt is empty or invalid. |
For a full list of formula errors, please read Formula errors.
Tips
- Be specific and clear in your prompts for better results.
- Use variables in prompts to include dynamic data, e.g. 'Summarise: {document_text}'.