ponder() and embed() are SQL functions on the same Flight SQL
connection you use for the lake. Each row
that reaches the function is one model call (ponder) or one embedding
(embed). Named arguments use =>.
Keep a LIMIT on the input. These calls are billed and capped.
ponder()
ponder() runs an LLM once per row and returns a typed column. Required
named arguments: provider, name, variant, version,
instruction, output, and inputs. inputs must be a
named_struct so each field has a prompt label.
instruction and output are constant strings (they are part of the
plan). server => 'vertex' is the production path.
output is one of Utf8, Int64, Float64, Boolean, Date32,
Timestamp, or Struct. schema is required when output is
Struct, and is a JSON Schema object as a string.
Classify Linear issue titles:
meta object (status, error, token usage,
latency). meta is reserved; do not put it in schema.
meta.status is ok (every required field present), partial
(parsed, some required fields missing; meta.error names them), or
error (the call failed). Primitive outputs (Utf8 and the rest)
return NULL on failure; the rest of the query still runs.
Pass model => some_column instead of inline provider / name /
variant / version when the model config is already a column. Do not
mix model with those inline arguments.
Optional: date (default latest), effort, tokens,
request_timeout_seconds.
embed()
embed() returns a unit-norm FixedSizeList<Float32> vector per row.
The only required argument is input. Omitted model coordinates use
the workspace default (Google gemini-embedding version 001, 768
dimensions, server vertex). purpose defaults to document.
NULL or empty input returns NULL. A failed provider call NULLs that
cell; the query continues.
purpose => 'query' for search strings and purpose => 'document'
for stored text. Vectors are only comparable when they share provider,
name, version, and dimensions. server is routing only; changing it
does not change the vector identity.
purpose values: similarity, classification, clustering.
A Plot that selects embed(...) materializes the
vectors. The Plot table exposes the vector column; a Lance sibling
parables.{parable}.{plot}__{column} holds the same vectors for ANN
search.