Guava.Field (Guava v0.34.0)

Copy Markdown View Source

A structured-data collection instruction given to the agent during a call.

Mirrors guava.types.Field. The key is used later with Guava.Call.get_field/2 to retrieve the collected value.

Field types requiring options ("multiple_choice", "calendar_slot") must supply either :choices (a small static list) or set :searchable and register a handler via Guava.Agent.handle_search_query/4.

Summary

Functions

Build and validate a Guava.Field.

Types

t()

@type t() :: %Guava.Field{
  choices: [String.t()],
  description: String.t(),
  field_type: String.t(),
  item_type: String.t(),
  key: String.t(),
  question: String.t(),
  required: boolean(),
  searchable: boolean()
}

Functions

new(attrs)

@spec new(keyword() | map()) :: t()

Build and validate a Guava.Field.

Accepts a keyword list or map of attributes. Raises ArgumentError for invalid combinations, matching the Python SDK's validation:

  • "datetime" collection is not implemented.
  • :choices are only valid for "multiple_choice" / "calendar_slot".
  • "calendar_slot" choices must be ISO-8601 (YYYY-MM-DDTHH:MM).