The agent-level entry point: the catalogs an agent supports, its
few-shot examples and its inference format, from which it creates one
A2UIAgent.RequestProcessor per request.
{:ok, config} = A2UIAgent.CatalogConfig.from_path("catalogs/basic.json")
generator = A2UIAgent.Generator.new([config], examples: [turn])
# per request, with the capabilities the renderer sent:
{:ok, processor} = A2UIAgent.Generator.create_processor(generator, capabilities)Catalog negotiation follows A2UIAgent.CatalogResolver.
Summary
Functions
Creates the processor for a renderer's capabilities.
Creates a generator over the registered catalogs.
Types
@type t() :: %A2UIAgent.Generator{ accepts_inline_catalogs: boolean(), catalogs: [A2UIAgent.CatalogConfig.t()], examples: [[map()]] | nil, format: A2UIAgent.Format.spec() }
Functions
@spec create_processor(t(), map() | nil, keyword()) :: {:ok, A2UIAgent.RequestProcessor.t()} | {:error, A2UICore.Error.t()}
Creates the processor for a renderer's capabilities.
A processor is negotiated for one renderer, so nil capabilities are a
:catalog error here (although A2UIAgent.CatalogResolver.resolve/3
accepts them). Option: :format overrides the generator's format for
this processor.
@spec new([A2UIAgent.CatalogConfig.t()], keyword()) :: t()
Creates a generator over the registered catalogs.
Options: :examples; :format (an A2UIAgent.Format.spec/0,
A2UIAgent.DirectJson by default); :accepts_inline_catalogs
(default false).