Skip to main content
Asks the model to classify text into one of the given categories.

Syntax

Arguments

  • input: A VARCHAR expression containing the text to classify.
  • categories: A nonempty constant ARRAY<VARCHAR> containing the candidate categories.
For the types and default behavior of provider and model, see Common calling rules.

Return value

Returns a nullable JSON object. The database asks the model to choose one category from categories and put it in the labels array, for example, {"labels":["support"]}. The database only checks that the result is a JSON object. It does not check the length of labels, whether the category appears in categories, or whether the classification is correct.

Examples