mix nous.profile.seal (nous v0.21.1)

Copy Markdown View Source

Fills a hand-written profile's manifest and id with Nous.Profile.seal/2, and writes the result as canonical JSON.

mix nous.profile.seal --agent MyApp.Agents.support priv/profiles/support.yaml
#=> writes priv/profiles/support.json

A profile file may be written without id and manifest. Sealing hashes the agent's base text that each component replaces, so from then on any change to that base makes the profile :stale (see mix nous.profile.check). Every other check of Nous.Profile.validate/2 runs first: a component addressing a tool or parameter the agent does not have is refused.

To refresh an already sealed profile after its base changed, use mix nous.profile.rebase, which records the old profile as the parent.

Options

  • --agent Mod.fun - a public 0-arity function returning the %Nous.Agent{} the profile is for (required)
  • --out PATH - where to write (default: PATH with a .json extension, so a .json input is rewritten in place)

Exit status

  • 0 - sealed and written
  • 1 - the profile is invalid or does not apply to the agent
  • 2 - an operational error: bad arguments, the agent factory failed, an unreadable or unwritable file