Skills.Runtime (fnord v0.9.29)
View SourceRuntime helpers for executing skills.
This module owns the glue between skill definitions (TOML) and the runtime components used to execute them:
- model preset parsing (skill
modelstring ->AI.Model.t()) - tool tag mapping (skill
tools->AI.Tools.toolbox()) - response_format validation
Keeping these helpers in one place avoids duplicating the execution rules
between the agent (AI.Agent.Skill) and the tool entry points.
Summary
Functions
Return the list of allowed model presets.
Return the list of allowed toolboxes.
Resolve a model preset string (from skill TOML) into an AI.Model struct.
Returns the reasoning preamble that is prepended to every skill's system prompt.
Build a toolbox from skill tool tags.
Validate a response_format value from a skill.
Types
Functions
@spec allowed_model_presets() :: [String.t()]
Return the list of allowed model presets.
This list is intended for interactive selection.
@spec allowed_toolboxes() :: [tool_tag()]
Return the list of allowed toolboxes.
Toolboxes are the skill's tool tags; they select tool groups.
@spec model_from_string(String.t()) :: {:ok, AI.Model.t()} | {:error, model_error()}
Resolve a model preset string (from skill TOML) into an AI.Model struct.
Supported values:
smartbalancedfastweblarge_contextlarge_context:<speed>where speed issmart|balanced|fast
The plain large_context form preserves the default behavior by calling
AI.Model.large_context/0.
@spec reasoning_preamble() :: String.t()
Returns the reasoning preamble that is prepended to every skill's system prompt.
This establishes baseline reasoning discipline for all skill agents.
@spec toolbox_from_tags([tool_tag()]) :: {:ok, AI.Tools.toolbox()} | {:error, toolbox_error()}
Build a toolbox from skill tool tags.
Tags are mapped to AI.Tools.with_* groupers. Toolbox construction is
deterministic and ignores input order.
The basic tag is required; it acts as the toolbox entrypoint.
@spec validate_response_format(nil | map()) :: {:ok, nil | map()} | {:error, response_format_error()}
Validate a response_format value from a skill.
nil is allowed and means default text responses.
When present, the response format must be a map and should include a type
key.