Interface CallerTurnContext

Live objects of the turn that made a tool call; set by gmi()'s tool hook and by a runtime seat's view.

interface CallerTurnContext {
    approvalGate?: ApprovalGateFn;
    budget?: SpendBudget;
    providerUserId?: string;
    toolNames?: ReadonlySet<string>;
    toolHooks?: readonly ((info) => Promise<null | ToolCallHookInfo>)[];
    dispatch?: ((requestDetails) => Promise<ToolCallResult>);
    toolCallGate?: GMIToolCallGate;
}

Properties

approvalGate?: ApprovalGateFn

The approval gate the turn's tool calls are asked.

budget?: SpendBudget

The turn's spend budget.

providerUserId?: string

The explicit user id the turn's session named; undefined when it named none.

toolNames?: ReadonlySet<string>

A seat's tool names: the only tools its turn lists and runs, a composed tool's steps included.

toolHooks?: readonly ((info) => Promise<null | ToolCallHookInfo>)[]

gmi(): the onBeforeToolExecution hooks the turn's calls run under, outermost first.

dispatch?: ((requestDetails) => Promise<ToolCallResult>)

The processToolCall of the view that made the call; the step gate runs each step of a composed tool through it.

Type declaration

toolCallGate?: GMIToolCallGate

The full runtime: the gate the turn's output guardrails that judge tool calls (config.evaluateToolCalls) ask before each call of the turn's own tool round. A GMI whose turn has one passes it with every call it makes, asked beside the sources the turn retrieved, and a team a call launches gives it to each of its seats' turns, so a seat's calls are judged as the launching turn's are, beside what that turn read.