Liking cljdoc? Tell your friends :D

toolnexus.batteries


agent-routerclj/s

(agent-router classifier)
(agent-router classifier opts)

Routes a task down the host's agent tree. Options: :bands, :role. No :on-error — the fallback IS the error outcome.

Routes a task down the host's agent tree. Options: :bands, :role. No
:on-error — the fallback IS the error outcome.
sourceraw docstring

as-hookclj/s

(as-hook b)
(as-hook b next)

The battery as a §8 hook composed with next (may be nil; never discarded): tool-guard -> :before-tool allow delegates; deny/ask short-circuit tool-relevance -> :before-llm overrides :tools content-guard -> :before-llm block throws; otherwise delegates model-router -> :before-llm overrides :model (only when different) tool-result-filter -> :after-tool filters "\n\n" chunks before-llm merge: the battery's override first, next sees the event as that override leaves it, and next's non-absent fields win.

The battery as a §8 hook composed with `next` (may be nil; never discarded):
  tool-guard         -> :before-tool   allow delegates; deny/ask short-circuit
  tool-relevance     -> :before-llm    overrides :tools
  content-guard      -> :before-llm    block throws; otherwise delegates
  model-router       -> :before-llm    overrides :model (only when different)
  tool-result-filter -> :after-tool    filters "\n\n" chunks
before-llm merge: the battery's override first, `next` sees the event as
that override leaves it, and next's non-absent fields win.
sourceraw docstring

checkclj/s

(check b x)
(check b task answer)

tool-guard: (check g {:name :arguments :description?}) -> {:action allow|ask|deny :reason :risk :sure :calibrated :error?} content-guard: (check g text) -> {:action allow|review|block :flagged :uncertain :scores :calibrated :error?} is-complete: (check ic task answer) -> {:complete :p :band :calibrated :error?}

tool-guard:   (check g {:name :arguments :description?}) -> {:action allow|ask|deny :reason :risk :sure :calibrated :error?}
content-guard: (check g text)        -> {:action allow|review|block :flagged :uncertain :scores :calibrated :error?}
is-complete:  (check ic task answer) -> {:complete :p :band :calibrated :error?}
sourceraw docstring

content-guardclj/s

(content-guard classifier opts)

Screens text. Options: :on-error (required), :bands, :role, :dimensions (ordered {:name :instructions}; default default-dimensions).

Screens text. Options: :on-error (required), :bands, :role, :dimensions
(ordered `{:name :instructions}`; default `default-dimensions`).
sourceraw docstring

default-dimensionsclj/s

ContentGuard's default dimensions (contract), in order.

ContentGuard's default dimensions (contract), in order.
sourceraw docstring

filter-chunksclj/s

(filter-chunks f query chunks)

tool-result-filter: (filter-chunks f query chunks) -> {:kept :dropped :calibrated :error?} — chunk indices in order. query is a string or a map.

tool-result-filter: (filter-chunks f query chunks) -> {:kept :dropped
:calibrated :error?} — chunk indices in order. `query` is a string or a map.
sourceraw docstring

is-completeclj/s

(is-complete classifier opts)

Does an answer complete its task. Options: :on-error (required), :bands, :role.

Does an answer complete its task. Options: :on-error (required), :bands, :role.
sourceraw docstring

latest-user-textclj/s

(latest-user-text messages)

The text of the last user message that has text: string content, or every {type "text"} part's text joined with "\n". A tool_result-only user message is skipped. "" when there is none.

The text of the last user message that has text: string content, or every
`{type "text"}` part's text joined with "\n". A tool_result-only user
message is skipped. "" when there is none.
sourceraw docstring

model-routerclj/s

(model-router classifier models)
(model-router classifier models opts)

OPT-IN per-query model routing (SPEC §8 "Right-size routing"). models is the user's ORDERED option list of {:id :description}. Options: :bands, :role.

OPT-IN per-query model routing (SPEC §8 "Right-size routing"). `models` is
the user's ORDERED option list of `{:id :description}`. Options: :bands, :role.
sourceraw docstring

pickclj/s

(pick r prompt fallback)
(pick r task agents fallback)

model-router: (pick r prompt fallback) -> {:model :routed :sure :probabilities :calibrated :error?} agent-router: (pick r task agents fallback), agents {:name :description :agents?} (a node with :agents is a group) -> {:agent :path :sure :probabilities :calibrated :error?}

model-router: (pick r prompt fallback)
  -> {:model :routed :sure :probabilities :calibrated :error?}
agent-router: (pick r task agents fallback), agents `{:name :description
:agents?}` (a node with :agents is a group)
  -> {:agent :path :sure :probabilities :calibrated :error?}
sourceraw docstring

risk-rubricclj/s

The default 4-level ToolGuard rubric (contract).

The default 4-level ToolGuard rubric (contract).
sourceraw docstring

role-agent-routerclj/s

source

role-content-guardclj/s

source

role-is-completeclj/s

source

role-model-routerclj/s

source

role-skill-relevanceclj/s

source

role-tool-guardclj/s

source

role-tool-relevanceclj/s

source

role-tool-result-filterclj/s

source

selectclj/s

(select b prompt items)

tool-relevance / skill-relevance: (select b prompt [{:name :description}]) -> {:selected :dropped :calibrated :error?} — names in input order.

tool-relevance / skill-relevance: (select b prompt [{:name :description}])
-> {:selected :dropped :calibrated :error?} — names in input order.
sourceraw docstring

skill-relevanceclj/s

(skill-relevance classifier opts)

Which skills are relevant. Options: :on-error (required), :bands, :role. No hook: feed :selected into the skill allowlist (an EMPTY selection must not be passed as an allowlist — empty means all).

Which skills are relevant. Options: :on-error (required), :bands, :role. No
hook: feed `:selected` into the skill allowlist (an EMPTY selection must not be
passed as an allowlist — empty means all).
sourceraw docstring

tool-guardclj/s

(tool-guard classifier opts)

Rates one tool call's risk. Options: :on-error (:open | :closed, required), :bands, :role, :ask-at (default 1.5), :deny-at (default 2.5).

Rates one tool call's risk. Options: :on-error (:open | :closed, required),
:bands, :role, :ask-at (default 1.5), :deny-at (default 2.5).
sourceraw docstring

tool-relevanceclj/s

(tool-relevance classifier opts)

Which tools the request needs. Options: :on-error (required), :bands, :role.

Which tools the request needs. Options: :on-error (required), :bands, :role.
sourceraw docstring

tool-result-filterclj/s

(tool-result-filter classifier opts)

Drops the chunks of a tool's output that are confidently irrelevant. Options: :on-error (required), :bands, :role.

Drops the chunks of a tool's output that are confidently irrelevant. Options:
:on-error (required), :bands, :role.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close