Guava.LLM (Guava v0.34.0)

Copy Markdown View Source

Thin wrapper over Guava's server-side LLM endpoint (v1/llm/generate).

Used by the higher-level helpers (Guava.IntentRecognizer, Guava.DatetimeFilter, Guava.DateRangeParser) and available directly.

Summary

Functions

Generate text from prompt, returning {:ok, text} | {:error, %Guava.Error{}}. When json_schema is given, the server constrains the output to match it and the returned string is JSON.

Functions

generate(client, prompt, json_schema \\ nil)

@spec generate(Guava.Client.t(), String.t(), map() | nil) ::
  {:ok, String.t()} | {:error, Guava.Error.t()}

Generate text from prompt, returning {:ok, text} | {:error, %Guava.Error{}}. When json_schema is given, the server constrains the output to match it and the returned string is JSON.

generate!(client, prompt, json_schema \\ nil)

@spec generate!(Guava.Client.t(), String.t(), map() | nil) :: String.t()

Like generate/3, but returns the text or raises Guava.Error.