functai for TypeScript - v0.1.0
    Preparing search index...

    Class ToolCallHook

    A tool about to run. ask(reason) asks a person whether it may run.

    Hierarchy

    • HookEvent
      • ToolCallHook
    Index
    approval: Approval

    What a person would be shown.

    effects: "reads" | "changes" | null
    function: string

    The AI function that asked for it.

    id: string
    input: unknown

    Its input, as the changes before this handler left it.

    invocation: number
    name: string
    path: string

    support/answer/refund.

    settings: Rec

    The asking call's settings (its approve among them).

    • Ask a person whether the tool may run: in a conversation the turn waits, saved, and goes on when someone answers; on a stream the call waits for s.approve(); a plain call refuses (approval-required). decide answers in place of a person. Resolves true, or false (the person's refusal is then the result the model sees).

      Parameters

      • Optionalreason: string | null
      • opts: { decide?: ApproveFunction | null } = {}

      Returns Promise<boolean>

    • This plugin's entries of a kind on the branch of the turn the call runs in ([] outside a conversation).

      Parameters

      • kind: string

      Returns Rec[]

    • Keep an entry of this plugin at the turn the call runs in (outside a conversation, a TypeError).

      Parameters

      • kind: string
      • data: unknown

      Returns Promise<void>