Skip to main content

Usage

The following example shows how the step can be used in a recipe.

Examples

  • Example 1
  • Signature
Bring the number of categories down to 10 categories
clean_categories(ds.categories, {
    "integration": "open-ai-1",
    "instructions": "Generate around 10 categories.",
    "model": {
        "id": "gpt-4o",
        "temperature": 0.7
    }
}) ->(ds.cleaned_categories)

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").
original
column[category|list[category]]
required
original column.
cleaned
column
required
cleaned column.

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

integration
string
required
Associated integration.
categories
array[string]
Categories desired in the result column. If passed instructions are ignored.
Item
string
Each item in array.
instructions
string
Further instructions to generate the desired set of categories. You can ask for things like ‘generate around 5 categories’
n_categories
[number, integer]
Approximate number of categories to generate. Can be a float from 0 to 1 (percentage of unique categories) or an integer greater than 1.
  • number
  • integer
{_}
number
number.Values must be in the following range:
0 ≤ {_} ≤ 1
model
object
Model Configuration. Configuration for OpenAI’s model.
id
string
default:"gpt-4o-mini"
OpenAI model to choose.Values must be one of the following:gpt-4o gpt-4o-mini o3-mini gpt-4.1 gpt-4.1-mini gpt-4.1-nano
temperature
number
default:"0.7"
Temperature. Higher means more creativity, but also makes the model more likely to hallucinate. Lower temperature yields more deterministic results.Values must be in the following range:
0temperature1
I