Skip to main content

AI

Extract structured data from each input row using an AI model. Define the desired fields with output, or reuse a saved definition with model_id.

Use AI to extract meaningful structured data. extract.ai can be used recipe-first, where the output schema is defined in the recipe, or model-first, where a saved extract.ai model is called by model_id.

info

For saved extract.ai models, this is the preferred calling pattern compared with using extract.custom.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputInput column name, column index, or list of columns supplied together as DATA for each row. If omitted, all dataframe columns are supplied.array, nullnullNo
outputDesired extraction. Use an object keyed by output column name for structured fields, a string for one prompted value, or an array of field names/definitions. Each field may use the schema options below.string, array, object, nullnullNo
Options
record_examplesWhole-record examples. Each example has a separate input value or record and the complete expected output record. Optional name and notes provide model-visible context. Use {name: ..., notes: ..., input: ..., output: ...}. Omitted nullable output fields are completed with null. Required non-null nested properties must be supplied. This differs from examples nested under one output field, which teach only that field.array, object, nullnullNo
web_searchEnable OpenAI Responses web search; the model decides when searching helps. When true, every row also receives web_search_sources: a deduplicated list of {title, url} objects in source order, or an empty list when no source was used. This reserved column is automatic. Requires protocol responses. Defaults to false.booleanfalseNo
instructionsAdditional guidance applied to every input row. Use this for decision rules, evidence priorities, normalization requirements, or other behavior that applies to the complete extraction.string, array, nullnullNo
Formatting
output_formatHow extracted fields are written. columns writes one dataframe column per field (default); dictionary keeps one object; concatenate joins fields into one string using char.string, null; one of:
  • dictionary
  • columns
  • concatenate
nullNo
charSeparator used only when output_format is concatenate. Defaults to comma-space.string", "No
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
Execution
threadsMaximum number of row-level requests sent in parallel. The configured default is 32.integer—No
timeoutMaximum seconds for one HTTP attempt. The configured default is 12; deadline can end the overall call sooner.number—No
deadlineTotal seconds allowed for the entire wrangle call, including queued work, retries, and backoff. The configured default is 15.number—No
Errors
retriesNumber of additional attempts after a retryable failure. The configured default is 1. Backoff and request timeouts remain bounded by deadline.integer—No
Details
api_keyOpenAI API key used for this wrangle, normally supplied through a recipe variable.string—Yes
model_idID of a saved extract.ai definition. Use it instead of defining an output schema. When output is also supplied with model_id in a recipe, output names the destination column or columns for the saved fields.string, nullnullNo
modelOpenAI model ID for this call. If omitted, uses the configured extract.ai default; a saved model definition may supply its own model.string—No
urlOverride the endpoint for the selected protocol. A chat/completions URL selects the legacy protocol only when protocol is omitted; new recipes should use the configured Responses endpoint.string—No
providerAI service provider. Currently only OpenAI is supported.string; one of:
  • openai
—No
protocolOpenAI API protocol. Responses is the configured default and is required for web_search; chat_completions remains available for legacy definitions.string; one of:
  • responses
  • chat_completions
—No
storeWhether OpenAI may store Responses API results. Defaults to false.boolean—No
cacheReuse identical successful results from the bounded warm-instance cache. Defaults to true. Set false when fresh model or web results are required.boolean—No
cache_ttlMaximum age in seconds for a cached result used by this call. Applies to extracted values and web_search_sources together.number—No
strictRequire OpenAI structured-output strict mode. Defaults to true. Definitions with dynamic dictionary keys automatically switch to non-strict provider mode and are still validated locally.boolean—No
reasoningResponses API reasoning controls. Set effort for reasoning-capable models. The configured default is none when that model supports it; otherwise the provider default applies.object—No
verbosityResponses API text verbosity for compatible models. Defaults to low when supported; ignored with a warning for incompatible models.string; one of:
  • low
  • medium
  • high
—No

Examples​

wrangles:
- extract.ai:
api_key: Your OpenAI api key
input: Product Specs
output:
Blade Diameter:
type: number
description: The diameter of the blade used, reported in inches.
default: N/A
examples:
- 4.5"
- 8 inch
Max. RPM:
type: number
description: The maximum rotations per minute (rpm).
default: 3600
examples:
- 3600 max. rpm
Product Specs
18V Cordless 4.5in angle grinder
120V 12in chop saw 3600 max. rpm
Blade DiameterMax. RPM
4.5 inches
12 inches3600
wrangles:
- extract.ai:
api_key: Your OpenAI api key
input: Product Specs
output:
Blade Diameter: The diameter of the blade used, reported in inches.
Max. RPM: The maximum rotations per minute (rpm).
Product Specs
18V Cordless 4.5in angle grinder
120V 12in chop saw 3600 max. rpm
Blade DiameterMax. RPM
4.5 inches
12 inches3600
wrangles:
- extract.ai:
api_key: Your OpenAI api key
model_id: xxxx-xxxx-xxxxxxxx
output:
- Colors
- Sizes
Items
Large yellow square
Medium orange triangle
ColorsSizes
[yellow]Large
[orange]Medium
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID21
Catalog keyextract.ai
Recipe keyextract.ai
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceextract
Documentation groupextract
AliasesNone
Runtime symbolwrangles.recipe_wrangles.extract.ai
Legacy UUIDd9f89b00-fda3-4f4c-826c-6417b9390607

Sources