Cortex Multi Prompt
Editions
Production use of this feature is available for specific editions only. Contact our sales team for more information.
The Cortex Multi Prompt transformation component uses Snowflake 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 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. Read Required 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).
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
Model
= drop-down
Select a language model from the drop-down menu. Review the Snowflake documentation for supported models, costs, and quotas.
Read Availability for details about which models are available in which regions.
User Prompt
= 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.
Inputs
= column editor
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.
Outputs
= column editor
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?".
Include Input Columns
= boolean
- 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.