Match a caller intent against a fixed set of choices using the Guava LLM endpoint, constrained so only the provided choices can be returned.
Summary
Functions
Classify intent. Returns a list of Guava.SuggestedAction ordered by
likelihood, or nil if nothing plausibly matches.
Like classify/2, but returns the matches or raises Guava.Error.
Build a recognizer. choices is a list of choice strings, or a map from
choice to a longer disambiguating description.
Types
@type t() :: %Guava.IntentRecognizer{ choices: [String.t()] | %{required(String.t()) => String.t()}, client: Guava.Client.t() }
Functions
@spec classify(t(), String.t()) :: {:ok, [Guava.SuggestedAction.t()] | nil} | {:error, Guava.Error.t()}
Classify intent. Returns a list of Guava.SuggestedAction ordered by
likelihood, or nil if nothing plausibly matches.
@spec classify!(t(), String.t()) :: [Guava.SuggestedAction.t()] | nil
Like classify/2, but returns the matches or raises Guava.Error.
@spec new(Guava.Client.t(), [String.t()] | %{required(String.t()) => String.t()}) :: t()
Build a recognizer. choices is a list of choice strings, or a map from
choice to a longer disambiguating description.