Polyman Documentation - v3.1.0
    Preparing search index...

    Interface ModelWorkerOptions

    What the worker needs. The factories let W0b pass the real classes.

    interface ModelWorkerOptions {
        provider: Provider;
        model: string;
        problemDir: string;
        runner: CliRunner;
        bus: EventBus;
        tools: Tool<unknown>[];
        createSession(deps: AgentSessionDeps): AgentSessionApi;
        createRegistry(permissions: PermissionGate): ToolRegistry;
        createSandbox(root: string, allowWrite: string[]): Sandbox;
        createGate(bus: EventBus, mode: PermissionMode): PermissionGate;
        secrets?(): string[];
        maxOutputTokens?: number;
        contextBudgetTokens?: number;
        temperature?: number;
        precheck?: WorkerPrecheck;
    }
    Index
    provider: Provider
    model: string
    problemDir: string

    The problem folder. Every worker works inside it.

    runner: CliRunner

    The workflow bus. Gets the workers' usage events, and their tool events (tool_call, tool_progress, tool_result) tagged with the task id.

    tools: Tool<unknown>[]

    The tools a worker may get, usually [...fsTools(), ...cliTools()]. Each task gets only the ones its kind needs. load_skill is added from skillTools() when it is not in the list.

    maxOutputTokens?: number

    Upper bound on generated tokens per call, 8000 by default.

    contextBudgetTokens?: number

    Context budget of a worker, WORKER_CONTEXT_TOKENS by default. The chat gives a smaller one for a model with a small window.

    temperature?: number

    Sampling temperature, 0.3 by default.

    precheck?: WorkerPrecheck

    Checks the task when the worker calls finish_task. A failed check is sent back to the worker as the tool result and the task goes on. Without it, finish_task always ends the task.

    • Makes a sandbox, new FolderSandbox(root, { allowWrite }).

      Parameters

      • root: string
      • allowWrite: string[]

      Returns Sandbox