The system prompt snippet of the Express format.
The snippet has three parts, separated by blank lines:
## Workflow Description:and the grammar rules (base_rules/2), with the rules for several catalogs when there are several;- the positional signatures of each catalog's components and
functions, and the catalog's own instructions, whose JSON
examples are rewritten as Express (
catalog_instructions/2); ### Examples:and each example turn as an Express block (examples/1), when there are examples.
An allowlist of message types (:allowed_messages) leaves out the
rules for the statements that write other messages.
Summary
Functions
The grammar rules. With an allowlist, the rules for statements that
write other messages are left out and the rest renumbered. Rule 15's
root = ... example names a component of the catalogs: the first one
holding a single child reference, else the first one. With several
catalogs, and components or data allowed, the rules for several
catalogs follow.
The signatures and instructions of one catalog (given by id), or of
all of them: with several catalogs, each under a # Catalog heading.
The example turns as Express blocks, separated by blank lines. An example the catalogs cannot express is an error.
Assembles the prompt snippet for catalogs. Options: :examples (a
list of turns, each a list of messages) and :allowed_messages.
The grammar rules, exactly as the reference writes them when every message type is allowed.
Functions
@spec base_rules(A2UIAgent.Express.Catalogs.t(), [String.t()] | nil) :: String.t()
The grammar rules. With an allowlist, the rules for statements that
write other messages are left out and the rest renumbered. Rule 15's
root = ... example names a component of the catalogs: the first one
holding a single child reference, else the first one. With several
catalogs, and components or data allowed, the rules for several
catalogs follow.
@spec catalog_instructions(A2UIAgent.Express.Catalogs.t(), String.t() | nil) :: String.t()
The signatures and instructions of one catalog (given by id), or of
all of them: with several catalogs, each under a # Catalog heading.
@spec examples(A2UIAgent.Express.Catalogs.t(), [[map()]] | nil) :: {:ok, String.t()} | {:error, A2UICore.Error.t()}
The example turns as Express blocks, separated by blank lines. An example the catalogs cannot express is an error.
@spec generate(A2UIAgent.Express.Catalogs.t(), keyword()) :: {:ok, String.t()} | {:error, A2UICore.Error.t()}
Assembles the prompt snippet for catalogs. Options: :examples (a
list of turns, each a list of messages) and :allowed_messages.
@spec rules() :: String.t()
The grammar rules, exactly as the reference writes them when every message type is allowed.