For the complete documentation index, see llms.txt. This page is also available as Markdown.

Functions

Functions available in the query language.

abs
abs(expr)

Returns the absolute value of the input.

add
add(expr1, expr2)

Adds the two inputs.

and
and(expr1, expr2)

Logical and operation of two boolean columns.

character_count
character_count(text)

Returns the number of characters in a text column.

  • Aliases

    • num_chars

coalesce
coalesce(expr)

Return the first expression that evaluates to a non-null value.

concat
concat(expr)

Concatenates multiple text columns into one.

contains

Returns true if the input string contains the substring.

count

Computes the number of rows in a column.

count_distinct

Computes the number of distinct non-null values in a column.

count_if

Computes the number of rows in a column that satisfy a condition.

date_trunc

Truncates a timestamp to the specified unit.

deterministic_sample

Returns a deterministic sample value in [0, 1) based on the input value.

divide

Divides the two inputs.

embed

Returns the embedding of a text column. Embedding model: all-mpnet-base-v2.

equal_to

Computes the element-wise equal to comparison of two columns.

  • Aliases

    • eq

filter

Filters a column using another column as a mask.

greater_than

Computes the element-wise greater than comparison of two columns. input1 > input2

  • Aliases

    • gt

greater_than_or_equal_to

Computes the element-wise greater than or equal to comparison of two columns. input1 >= input2

  • Aliases

    • gte

icontains

Returns true if the input string contains the substring, ignoring case.

is_valid_json

Returns true if the input string is valid json.

less_than

Computes the element-wise less than comparison of two columns. input1 < input2

  • Aliases

    • lt

less_than_or_equal_to

Computes the element-wise less than or equal to comparison of two columns. input1 <= input2

  • Aliases

    • lte

levenshtein

Returns Damerau-Levenshtein distance between two strings.

list_contains

Returns True if the list contains the value.

list_extract

Extracts the item at the given index from a list.

list_has_duplicate

Returns True if the list has duplicated items.

list_length

Returns the length of lists in a list column.

list_most_common

Most common item in list.

list_starts_with

Returns True if the list starts with the value.

list_zip

Zips multiple lists into a list of structs.

llm_answer_groundedness

Classifies whether the generated answer is grounded in and supported by the provided context.

llm_answer_groundedness_with_justification

Classifies whether the generated answer is grounded in and supported by the provided context.

llm_answer_refusal

Classifies whether the model refused to answer the user's question.

llm_answer_refusal_with_justification

Classifies whether the model refused to answer the user's question.

llm_answer_relevancy

Classifies whether the generated answer is relevant and responsive to the user's question.

  • Aliases

    • rag_answer_relevancy

llm_answer_relevancy_with_justification

Classifies whether the generated answer is relevant and responsive to the user's question.

llm_classify

Classifies text into custom categories you define, using your own prompt and labels.

llm_classify_with_justification

Classifies text into custom categories you define, using your own prompt and labels.

llm_context_relevancy

Classifies whether the retrieved context is relevant to the user's question.

llm_context_relevancy_with_justification

Classifies whether the retrieved context is relevant to the user's question.

llm_conversation_summary

Generates a concise summary of a full conversation session between an AI assistant and a user.

llm_question_clarity

Scores how clear and well-formed a question is, from 1 (ambiguous or incoherent) to 5 (perfectly clear).

llm_question_clarity_with_justification

Scores how clear and well-formed a question is, from 1 (ambiguous or incoherent) to 5 (perfectly clear).

llm_score

Scores text on a 1–5 scale using your own custom evaluation prompt.

llm_score_with_justification

Scores text on a 1–5 scale using your own custom evaluation prompt.

llm_summarization

Generates a concise summary of a single conversational exchange (input and output).

llm_text_frustration

Scores the level of user frustration expressed in a text, from 1 (not frustrated) to 5 (extremely frustrated).

llm_text_frustration_with_justification

Scores the level of user frustration expressed in a text, from 1 (not frustrated) to 5 (extremely frustrated).

llm_text_sentiment

Classifies the overall sentiment of a text as positive, negative, or neutral.

  • Aliases

    • text_sentiment

llm_text_sentiment_with_justification

Classifies the overall sentiment of a text as positive, negative, or neutral.

llm_text_similarity

Scores how semantically similar an output is to a target reference, from 1 (completely different) to 5 (equivalent).

  • Aliases

    • text_similarity

llm_text_similarity_with_justification

Scores how semantically similar an output is to a target reference, from 1 (completely different) to 5 (equivalent).

llm_text_toxicity

Scores how toxic or harmful a piece of text is, from 1 (not toxic) to 5 (highly toxic).

llm_text_toxicity_with_justification

Scores how toxic or harmful a piece of text is, from 1 (not toxic) to 5 (highly toxic).

llm_user_frustration

Scores the overall user frustration across a conversation session, from 1 (satisfied) to 5 (extremely frustrated).

llm_user_frustration_with_justification

Scores the overall user frustration across a conversation session, from 1 (satisfied) to 5 (extremely frustrated).

map_extract

Extracts the value for a given key from a map, returning null if the key is not in the map.

max

Computes the max of a column.

mean

Computes the mean of a column.

median

Computes the median of a column.

min

Computes the min of a column.

mode

Computes the mode of a column.

multiply

Multiplies the two inputs.

negate

Returns the negation of the input.

not

Logical not operation of a boolean column.

not_equal_to

Computes the element-wise not equal to comparison of two columns.

  • Aliases

    • neq

or

Logical or operation of two boolean columns.

percentile

Computes the nth percentile of a column.

rouge1

Returns the rouge1 score between two columns.

rouge2

Returns the rouge2 score between two columns.

rougeL

Returns the rougeL score between two columns.

rougeLsum

Returns the rougeLsum score between two columns.

stddev

Computes the sample standard deviation of a column.

struct_extract

Extracts a field from a struct expression.

subtract

Subtracts the two inputs.

sum

Computes the sum of a column.