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[源代码]#

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.

示例

Construct a harness whose repository shares this interpreter:

harness = JITHarness(directory, host=InProcessToolHost())
load(directory, scan, bridge)[源代码]#

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

参数:
返回类型:

HostedRepo

async invoke(name, arguments)[源代码]#

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.

参数:
  • name (str)

  • arguments (dict[str, JsonValue])

返回类型:

ToolResult

close()[源代码]#

Drop the imported modules.

返回类型:

None