Skip to main content

Module filter

Module filter 

Source
Expand description

Tool-use filter policies — the framework’s concrete behavior for the tool-use batch between model output and tool dispatch.

§One trait, one seam

This crate defines ToolUseHook (the seam TurnRunner::with_hook consumes, alongside the driver itself) and the concrete policies below. Filters implement that trait directly — there is no second extension trait and no alias layer. The default is PassthroughHook (no opinion); dedup / kill-switch / approval are framework or host concerns, never kernel facts.

Structs§

AllowAllFilter
A filter that lets every call through unchanged.
DedupFilter
Default deduplication policy — same-batch (tool_name, arguments) dedup. Subsequent occurrences of an identical pair are pushed to rejected with the original call_id and a {"error": "duplicate tool call"} payload.
DenyAllFilter
A filter that rejects every call with a fixed reason.
FilterChain
Composes multiple filters sequentially.