jeevesagent.architecture.tool_host_wrappers¶
Tool-host wrappers used by multi-agent architectures.
A ToolHost is a black box from
the agent’s point of view. Architectures that need to inject extra
tools per run (Supervisor’s delegate, Swarm’s handoff, the
Agent.run(extra_tools=...) per-run kwarg) build an
ExtendedToolHost that combines a base host with a fixed
list of extra Tool instances.
Why a wrapper rather than mutating the base host?
User-provided agents stay untouched — running an agent inside a supervisor doesn’t permanently add a
delegatetool to that agent’s host.Additive only — extras coexist with the base’s tools; conflicts resolve in favour of the extras (the architecture’s tool wins over a same-named user tool, which is what the architecture wants).
Same shape as the
ToolHostprotocol — drop-in.
Classes¶
Combine a base |
Module Contents¶
- class jeevesagent.architecture.tool_host_wrappers.ExtendedToolHost(base: jeevesagent.core.protocols.ToolHost, extras: list[jeevesagent.tools.registry.Tool])[source]¶
Combine a base
ToolHostwith N extraTools.list_toolsreturns the base’s defs plus the extras’ defs.calldispatches to the matching extra by name; falls through to the base for everything else. Extras win on name conflict.- async call(tool: str, args: collections.abc.Mapping[str, Any], *, call_id: str = '') jeevesagent.core.types.ToolResult[source]¶
- register(item: jeevesagent.tools.registry.Tool) jeevesagent.tools.registry.Tool[source]¶
Mutably append a Tool to the extras pool.
Mirrors
InProcessToolHost.register()so callers (notably the skills system, which lazy-registers Tools whenload_skillfires) can add to either host kind without special-casing.