Everything an agent needs to answer one request: the negotiated catalogs, the inference format bound to them, its prompt snippet and its parsers.
A processor is normally created by A2UIAgent.Generator.create_processor/3
from the renderer's capabilities.
{:ok, processor} = A2UIAgent.RequestProcessor.new(catalogs, examples: [turn])
{:ok, prompt} = A2UIAgent.RequestProcessor.prompt(processor)
{:ok, parts} = A2UIAgent.RequestProcessor.parse_response(processor, model_output)
Summary
Functions
The active catalogs, in the renderer's order of preference.
Creates a processor over the active catalogs.
Parses and validates a complete model response with a fresh parser.
Option: :wrapped (default true).
A fresh parser bound to the active catalogs.
The format's system prompt snippet.
Types
@type t() :: %A2UIAgent.RequestProcessor{ catalogs: [A2UICore.Catalog.t()], examples: [[map()]] | nil, format: struct() }
Functions
@spec active_catalogs(t()) :: [A2UICore.Catalog.t()]
The active catalogs, in the renderer's order of preference.
@spec new([A2UICore.Catalog.t()], keyword()) :: {:ok, t()} | {:error, A2UICore.Error.t()}
Creates a processor over the active catalogs.
Options: :examples — few-shot example turns, each checked with
A2UIAgent.PayloadValidator against the catalogs; :format — the
A2UIAgent.Format.spec/0 (A2UIAgent.DirectJson by default).
@spec parse_response(t(), String.t(), keyword()) :: {:ok, [A2UIAgent.DirectJson.Parser.part()]} | {:error, A2UICore.Error.t()}
Parses and validates a complete model response with a fresh parser.
Option: :wrapped (default true).
A fresh parser bound to the active catalogs.
@spec prompt(t()) :: {:ok, String.t()} | {:error, A2UICore.Error.t()}
The format's system prompt snippet.