InProcessToolHost#

Let a model keep its own tools and notes in a repository on disk. See the guide.

class zett_agent.jit_harness.host.InProcessToolHost[source]#

Import and run a repository in the agent’s own interpreter.

This is the fast host: module globals stay in the agent, nested calls are ordinary method calls, and a tool may return any value. Repository code can also do anything the agent process can do, including exit it or never return.

Examples

Construct a harness whose repository shares this interpreter:

harness = JITHarness(directory, host=InProcessToolHost())
load(directory, scan, bridge)[source]#

Import the package here, with bridge available in module globals.

Parameters:
Return type:

HostedRepo

async invoke(name, arguments)[source]#

Run a tool that was imported here.

The harness reaches a tool through the AgentTool it registered, so this host is never asked to run one; the call exists so both hosts answer the same way.

Parameters:
  • name (str)

  • arguments (dict[str, JsonValue])

Return type:

ToolResult

close()[source]#

Drop the imported modules.

Return type:

None