surfacecleaningnormalize_currency_llm
Cleaningscalar · returns json

NORMALIZE_CURRENCY_LLM

LLM-backed currency parsing with approximate rates (escape hatch for NORMALIZE_CURRENCY)

Per-row — runs once for each row.

cleaningllmllm-escape-hatchcurrency

Syntax

NORMALIZE_CURRENCY_LLM({{ value }})
NORMALIZE_CURRENCY_LLM({{ value }}, '{{ target_currency }}')
NORMALIZE_CURRENCY_LLM({{ value }}, '{{ target_currency }}', '{{ reference_date }}')

Arguments

nametypedescription
valueVARCHAR
target_currency(optional)VARCHAR
reference_date(optional)VARCHAR

About

LLM-backed escape hatch for currency parsing. Unlike the canonical NORMALIZE_CURRENCY path, this variant asks the LLM to *also* provide an approximate exchange rate — with the explicit caveat that the LLM's rates come from stale training data and are NOT suitable for anything financial. **Do not use for real financial work.** For actual currency conversion in production, call an external forex API at the application layer. This escape hatch exists for demos, rough estimates, and cases where format-only normalization isn't enough. For format-only normalization (recommended), use NORMALIZE_CURRENCY — it's deterministic, honest about its limitations, and much faster.

Examples

LLM escape hatch converts currency

SELECT
  normalize_currency_llm ('100 dollars', 'EUR')

Nearby rabbit holes

same domain
Climb back to The Looking Glass