> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate

Production use of this feature is only available on specific Maia plans. [Contact our Sales team](https://www.maia.ai/contact-us) for more information.

\<table><tbody><tr><td>Project Availability</td>
            \<td /></tr>
          \<tr><td>Component Type</td>
            \<td>Transformation</td></tr>
          \<tr><td>Connection Inputs</td>
            \<td>One</td></tr>
          \<tr><td>Connection Outputs</td>
            \<td>Unlimited</td></tr></tbody></table>

The **Generate** transformation component uses the Google BigQuery [AI.GENERATE](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-generate) function to send a prompt to a Google Gemini model for each row of your input data.The component combines your prompt with the values of the input columns you select, and adds the model's response to the output—either as a single text column or, when you define an output schema, as one or more typed columns.### Use caseThis component lets you integrate generative AI output into your transformation pipeline. For example, you can use it to:* Summarize, rewrite, or translate text, such as product descriptions or support tickets.
* Classify text, such as customer feedback, into categories that you describe in the prompt.
* Draft replies to customer messages.
* Extract details from unstructured text into typed columns—for example, a sentiment label and a satisfaction score.> [!NOTE]
>
> The component calls the model once for each input row, so running it on large tables can incur significant inference costs. Usage is also subject to Google BigQuery's [generative AI quotas](https://docs.cloud.google.com/bigquery/quotas#generative_ai_functions). For guidance, read [Manage inference costs](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-generate#manage_inference_costs).***## PrerequisitesThe Google Cloud service account that calls the Gemini model must have the [Agent Platform User](https://docs.cloud.google.com/iam/docs/roles-permissions/aiplatform#aiplatform.user) role (`roles/aiplatform.user`). Which service account this is depends on the **Agent platform connection** property:- **Agent platform connection left blank:** Google BigQuery calls the model as the Google Cloud service account that your Maia environment uses to access Google BigQuery. This is the service account in the [cloud provider credentials](https://docs.maia.ai/docs/guides/cloud-credentials.md) associated with the environment or, for a [Hybrid SaaS](https://docs.maia.ai/docs/guides/hybrid-saas-bigquery.md) environment with no associated credentials, the Maia runner's own service account.
- **Agent platform connection set:** Google BigQuery calls the model as the service account of the Google BigQuery connection. To create a connection and grant its service account the required role, read [Run generative AI queries with a Google BigQuery Connection](https://docs.cloud.google.com/bigquery/docs/permissions-for-ai-functions#run-connect).***## Properties**Name** `string` *required*A human-readable name for the component.**Model** `drop-down` *required*Select the Gemini model to use. The following options are currently available:- `gemini-3.5-flash`
- `gemini-3.1-flash-lite`
- `[Custom]`: Use a Gemini model that isn't listed here, which you name in **Custom model**.Google serves `gemini-3.5-flash` and `gemini-3.1-flash-lite` only from multi-regional endpoints. Read the [AI.GENERATE](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-generate#arguments) documentation to learn which endpoint Google BigQuery uses for the location your query runs in.**Custom model** `string` *required*The name of the Gemini model to use—for example, `gemini-2.5-pro`. Read the [AI.GENERATE](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-generate#arguments) documentation for the Gemini models that Google BigQuery supports.This property is only available when **Model** is set to **\[Custom]**.**User prompt** `text editor` *required*The instruction to send to the model for each row—for example, `Summarize this customer review in one sentence.`**Inputs** `column editor`Select the source columns whose values are sent to the model with the prompt.- **Column Name:** A column from the input table.
- **Descriptive Name (Optional):** An alternate descriptive name to better contextualize the column. Recommended if your column names are low-context.When you select inputs, the component adds a colon and a blank line after your prompt, then sends each input as a `#<name>` heading followed by its value, with a blank line between inputs. `<name>` is the descriptive name if you've set one, or the column name otherwise. For example:```text theme={null}
Classify the sentiment of this review:

#Product
Deluxe Kettle

#Review
Broke after a week.
```If you don't select any inputs, only the prompt is sent.Every row is sent to the model, including rows with no input data. NULL input values are sent as empty text, except in `STRUCT`, `ARRAY`, and `JSON` columns, where they're sent as `null`. Input values that aren't text are converted to text before they're sent: `STRUCT`, `ARRAY`, and `JSON` values are converted to JSON text, and other data types are cast to `STRING`. `GEOGRAPHY` columns aren't supported.Toggle **Text mode** on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read [Text mode](https://docs.maia.ai/docs/guides/components-overview.md#text-mode).To use grid variables, toggle **Use Grid Variable** on. For more information, read [Grid variables](https://docs.maia.ai/docs/guides/grid-variables.md).**Output type** `drop-down` *required*- **Text:** Adds one column containing the model's response. This is the default setting.
- **Structured:** Adds one typed column for each field defined in **Output schema**.**Output schema** `text editor` *required*The fields for the model to generate, as a comma-separated list of names and data types—for example, `name STRING, age INT64, phone_number STRING`. Each field becomes a column in the output, so field names must be unique. They must also be different from **Status column name** when **Include status** is set to **Yes**, and from the names of the input columns when **Include input columns** is set to **Yes**.The supported data types are `STRING`, `INT64`, `FLOAT64`, `BOOL`, `ARRAY`, and `STRUCT`. You can mark a field as `NOT NULL` so that the model always returns a value for it, and describe a field using `OPTIONS(description = '<description>')` to tell the model what the field should contain.This property is only available when **Output type** is set to **Structured**.**Include input columns** `boolean` *required*- **Yes:** Outputs both your source input columns *and* the new columns. This also includes input columns that aren't selected in **Inputs**. This is the default setting.
- **No:** Only outputs the new columns.**Result column name** `string` *required*The name of the column that holds the model's response. The default is `result`.When **Include status** is set to **Yes**, the name must be different from **Status column name**. When **Include input columns** is set to **Yes**, it must also be different from the names of the input columns.This property is only available when **Output type** is set to **Text**.**Include status** `boolean` *required*- **Yes:** Adds a column that reports the outcome of the model call for each row. Read [Explanation of output](#explanation-of-output) for details.
- **No:** Doesn't add a status column. This is the default setting.**Status column name** `string` *required*The name of the status column. The default is `status`.When **Output type** is set to **Text**, the name must be different from **Result column name**. When **Include input columns** is set to **Yes**, it must also be different from the names of the input columns.This property is only available when **Include status** is set to **Yes**.**Agent platform connection** `string`The Google BigQuery connection to use to call the model, in the format `<project_id>.<location>.<connection_id>`—for example, `myproject.us.myconnection`. Leave this blank to call the model as the Google Cloud service account that your environment uses to access Google BigQuery.**Parameter mode** `drop-down` *required*- **Basic:** Set the model's parameters using **Temperature**, **Top P**, and **Max output tokens**. This is the default setting.
- **Advanced:** Set the model's parameters as JSON in **Model parameters**. Any values set in the **Basic** properties aren't used.**Temperature** `floating point number`A value between 0 and 2 (inclusive) that controls the randomness of the model's output. Lower values make the output more focused and consistent; higher values make it more varied. If you leave this blank, the model's default is used.This property is only available when **Parameter mode** is set to **Basic**.**Top P** `floating point number`A value between 0 and 1 (inclusive) that controls the randomness of the model's output by limiting the set of tokens the model chooses from. If you leave this blank, the model's default is used.This property is only available when **Parameter mode** is set to **Basic**.**Max output tokens** `integer`The maximum number of tokens the model can generate for each response. The value must be 1 or more. If you leave this blank, the model's default is used.> [!WARNING]
>
> Newer Gemini models use part of this limit for internal reasoning, so a low value can return an empty result.This property is only available when **Parameter mode** is set to **Basic**.**Model parameters** `JSON`A JSON object of parameters to send to the model. You can set any field in the [request body](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest/v1/projects.locations.publishers.models/generateContent#request-body) of Google's `generateContent` method except `contents`, which the component fills in from your prompt and inputs. The JSON must be well-formed.To set the temperature, Top P, or maximum output tokens in this mode, include them in `generation_config`—for example:```json theme={null}
{"generation_config": {"temperature": 0.2, "max_output_tokens": 1024}}
```To ground responses with Google Search:```json theme={null}
{"tools": [{"googleSearch": {}}]}
```To lower the model's thinking level, which reduces latency and cost:```json theme={null}
{"generation_config": {"thinking_config": {"thinking_level": "LOW"}}}
```This property is only available when **Parameter mode** is set to **Advanced**.## Explanation of outputThe component's output depends on **Output type**:- **Text:** The input columns (if **Include input columns** is set to **Yes**), followed by a text column, named by **Result column name**, that contains the model's response.
- **Structured:** The input columns (if **Include input columns** is set to **Yes**), followed by one column for each field in **Output schema**.If **Include status** is set to **Yes**, the output also contains a status column. The status is empty when the model call succeeds. If the call fails, or Gemini's safety filters block the response, the model's output columns are NULL. If the call fails, the status column contains the error for that row.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.