Briyah SDK - v2.0.18
    Preparing search index...

    Interface ToolAgentDocuments

    The documents held in the calling agent's context — the ones prepended to every request it makes.

    Scoped to the caller by Briyah, from the room's own record of who is calling, so a tool can hold documents for the agent that asked and for no other.

    Holding a document is the expensive way to use it: it rides every one of the agent's subsequent requests until it is detached. It is the right way when the work needs the whole document at once — a full review, a comparison of two — and the wrong way to look one thing up.

    interface ToolAgentDocuments {
        attach(fileName: string, body: string): Promise<string>;
        detach(documentId: string): Promise<boolean>;
        held(): Promise<ToolHeldDocument[]>;
    }
    Index
    • Attaches text to the calling agent's context. A document already held under the same file name is replaced rather than duplicated.

      Parameters

      • fileName: string
      • body: string

      Returns Promise<string>

      The new attachment's id

    • Detaches one of the calling agent's documents.

      Parameters

      • documentId: string

      Returns Promise<boolean>

      Whether it was held

    • Everything the calling agent holds, including documents its configuration attached.

      Returns Promise<ToolHeldDocument[]>