> ## 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.

# Cortex Multi Prompt

export const ComponentMetadata = ({warehouses, unsupportedWarehouses = [], componentType, connectionInputs, connectionOutputs}) => {
  const allWarehouses = [...warehouses.map(w => ({
    name: w,
    supported: true
  })), ...unsupportedWarehouses.map(w => ({
    name: w,
    supported: false
  }))];
  return <div style={{
    background: 'var(--colors-background-light, #f9fafb)',
    border: '1px solid var(--colors-border-default, #e5e7eb)',
    borderRadius: '12px',
    padding: '20px 28px',
    marginBottom: '28px',
    boxShadow: '0 1px 4px rgba(0,0,0,0.10)'
  }}>
      <table style={{
    width: '100%',
    borderCollapse: 'collapse'
  }}>
        <tbody>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    width: '180px'
  }}>Project Availability</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>
              <div style={{
    display: 'flex',
    flexWrap: 'wrap',
    gap: '8px'
  }}>
                {allWarehouses.map((w, i) => <span key={i} style={{
    background: w.supported ? '#dcfce7' : '#fee2e2',
    color: w.supported ? '#15803d' : '#b91c1c',
    border: `1px solid ${w.supported ? '#bbf7d0' : '#fca5a5'}`,
    borderRadius: '9999px',
    padding: '3px 12px',
    fontSize: '0.85rem',
    fontWeight: '500',
    whiteSpace: 'nowrap'
  }}>
                    {w.name} {w.supported ? '✅' : '❌'}
                  </span>)}
              </div>
            </td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Component Type</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{componentType}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Inputs</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{connectionInputs}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Outputs</td>
            <td style={{
    verticalAlign: 'middle'
  }}>{connectionOutputs}</td>
          </tr>
        </tbody>
      </table>
    </div>;
};

<ComponentMetadata warehouses={["Snowflake"]} unsupportedWarehouses={["Databricks", "Amazon Redshift", "BigQuery"]} componentType="Transformation" connectionInputs="One" connectionOutputs="Unlimited" />

<Info>
  Production use of this feature is available for specific editions only. [Contact our sales team](https://www.matillion.com/contact) for more information.
</Info>

The [Cortex Multi Prompt](https://docs.snowflake.com/en/sql-reference/functions/complete-snowflake-cortex) transformation component uses [Snowflake Cortex](https://www.snowflake.com/en/data-cloud/cortex/) to receive a prompt and then generate a response (a completion) using your chosen supported language model.

Cortex Multi Prompt is an advancement of the [Cortex Completions](/docs/components/cortex-completions) component, with the functionality for users to add multiple user prompts in the **Outputs** parameter. With Cortex Multi Prompt, you can send multiple queries to your language model via Cortex Completions for the same dataset, without having to write a complex user prompt.

To use this component, you must use a Snowflake role that has been granted the [SNOWFLAKE.CORTEX\_USER database role](https://docs.snowflake.com/en/sql-reference/snowflake-db-roles#label-snowflake-db-roles-cortex-schema). Read [Required Privileges](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#label-cortex-llm-privileges) to learn more about granting this privilege.

To learn more about Snowflake Cortex, such as availability, usage quotas, managing costs, and more, read [Large Language Model (LLM) Functions (Snowflake Cortex)](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions).

### Use case

This component lets you combine different prompts in a single component. For example, you can use it to:

* Generate multiple variations on an advertisement to target different audience segments.
* Create differently worded email campaigns to compare engagement.

***

## Properties

<ResponseField name="Name" type="string" required>
  A human-readable name for the component.
</ResponseField>

### Configure

<ResponseField name="Model" type="drop-down" required>
  Select a language model from the drop-down menu. Review the [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/functions/complete-snowflake-cortex#arguments) for supported models, [costs](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#label-cortex-llm-cost-considerations), and [quotas](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#label-cortex-llm-quotas).

  Read [Availability](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#availability) for details about which models are available in which regions.
</ResponseField>

{/* <!-- param-start:[inputs] | warehouses: [snowflake] --> */}

<ResponseField name="Inputs" type="column editor" required>
  Select the source columns to feed as input to the model.

  * **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.
</ResponseField>

{/* <!-- param-start:[includeInputColumns] | warehouses: [snowflake] --> */}

<ResponseField name="Include Input Columns" type="boolean" required>
  * **Yes:** Outputs both your source input columns *and* the new completion columns. This will also include those input columns *not* selected in **Inputs**.
  * **No:** Only outputs the new completion columns.
</ResponseField>

{/* <!-- param-start:[userPrompt] | warehouses: [snowflake] --> */}

<ResponseField name="User Prompt" type="text editor">
  A plain-text prompt provided by the user. This prompt lets the user provide basic instructions and background information on the data.

  To use variables in this field, type the name of the variable prefixed by the dollar symbol and surrounded by \{ } brackets, as follows: `${variable}`. Once you type `${`, a drop-down list of autocompleted suggested variables will appear. This list updates as you type; for example, if you type `${date`, functions and variables containing `date` will be listed.
</ResponseField>

{/* <!-- param-start:[outputs] | warehouses: [snowflake] --> */}

<ResponseField name="Outputs" type="column editor" required>
  Define the parameters for the output data including what each output column should be named and what prompt should be used to query the language model about the input data.

  * **Column Name:** The name of a column that will hold responses to the corresponding prompt.
  * **Prompt:** A prompt to the language model about the input data.

  For example, if your input data was a table of flights and vacation data, you might set one column name as `carbon_footprint` and then set the corresponding prompt as "What is the estimated carbon footprint in tons per passenger?".
</ResponseField>

{/* <!-- param-start:[failureMode] | warehouses: [snowflake] --> */}

<ResponseField name="Failure Mode" type="drop-down" required>
  Select the behavior when the language model fails to generate a response.

  * **Continue on Error:** If the language model fails to generate a response, the component will continue processing and return a `null` value in the output column. This is the default behavior.
  * **Throw Error:** If the language model fails to generate a response, the component will throw an error and stop processing.
</ResponseField>

{/* <!-- param-start:[temperature] | warehouses: [snowflake] --> */}

<ResponseField name="Temperature" type="floating point number">
  A value between 0 and 1 (inclusive) to control the randomness of the output of the language model. Higher temperatures (for example, 0.8) will result in more diverse and random outputs. Lower temperatures (for example, 0.2) make the output more focused and deterministic.
</ResponseField>

{/* <!-- param-start:[topP] | warehouses: [snowflake] --> */}

<ResponseField name="Top P" type="floating point number">
  A value between 0 and 1 (inclusive) to control the randomness of the output of the language model—typically used as an alternative to temperature.

  Top P restricts the set of possible tokens that the mode will output, whereas Temperature influences which tokens are chosen at each step.

  Many LLM models recommend altering Top P *or* Temperature, but *not* both.
</ResponseField>

{/* <!-- param-start:[maxTokens] | warehouses: [snowflake] --> */}

<ResponseField name="Max Tokens" type="integer">
  Set the maximum number of output tokens in the response. A small number of max tokens can result in truncated responses.
</ResponseField>

{/* <!-- param-start:[guardrails] | warehouses: [snowflake] --> */}

<ResponseField name="Guardrails" type="boolean" required>
  When set to **Yes**, responses that could be considered unsafe or harmful will be filtered out of the model's output via [Cortex Guard](https://docs.snowflake.com/en/user-guide/snowflake-cortex/aisql#label-cortex-llm-complete-cortex-guard).
</ResponseField>
