Parameters

Create AI Templates with Parameterization

Parameterizing your AI workbook allows you to create dynamic, reusable AI templates. This feature is similar to parameterizing Jupyter notebooks and offers a range of benefits, including increased efficiency and consistency in your workflows. Parameterization is a powerful tool for managing and optimizing your AI workflows.

Here are our favorite AI Templates to get you started on parameterization:

What are Parameters?

Parameters are variables that you can define and pass into any cell within your workbook. You can set both global parameters and local parameters.

For example, you can define parameters such as language or product in a cell like this with the handlebars syntax as shown below:

"Write a LinkedIn DM in {{language}} as a sales rep selling {{product}}."

Global Parameters

You can set global parameters (workbook parameters) for your entire workbook. Click on '{}' on the top of your workbook and set your global parameters that can be used in any cell of the workbook.

Local Parameters

To change the parameters, open 'Parameters {}'. You can then reuse this cell and update the language and product parameters to different values as needed.

You can reference parameters in the cell input and also the cell's system prompt (in Cell Settings).

Note: Local parameters will override the global parameters if they have the same name.

Referencing Output from One Cell in Another

In addition to defining and passing parameters within a single cell, you can also reference the output from one cell in another cell. This allows you to create complex, interconnected workflows within your workbook.

For example, you might have a cell that generates a LinkedIn DM, and another cell that rewords that DM and translates it into a different language. You could set this up using parameters and cell references like this:

β€œReword β€˜{{gpt4_cell_1.output}}’ in the form of β€˜{{shakespeare_cell.output}}’, and translate to {{language}}”.

Running Cells

You have two options for running cells that reference other cells:

  • Run a Cell (execute with dependencies): This will run the selected cell and all its dependencies, ensuring that all necessary data and outputs are up-to-date.

  • Run All: This will execute the entire workbook, running all cells and handling dependencies.

Parameterizing your workbook offers several key benefits. By creating reusable templates, you can save time and effort on repetitive tasks. Using parameters ensures that your work is consistent across different cells and workbooks.

Last updated