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

    Interface DocumentSource

    A host's documents.

    interface DocumentSource {
        description: string;
        name: string;
        fullText(context: unknown, documentId: string): Promise<DocumentText>;
        list(context: unknown): Promise<DocumentSummary[]>;
        read(
            context: unknown,
            documentId: string,
            range: PageRange,
        ): Promise<DocumentPages>;
        search(
            context: unknown,
            request: DocumentSearchRequest,
        ): Promise<DocumentHit[]>;
    }
    Index
    description: string

    One sentence for the agent: what these documents are.

    name: string
    • The whole document, for holding in an agent's context. Null as for read.

      Parameters

      • context: unknown
      • documentId: string

      Returns Promise<DocumentText>

    • Every document the context may see. Called often; keep it cheap.

      Parameters

      • context: unknown

      Returns Promise<DocumentSummary[]>

    • The pages in a range. Briyah clamps the range to the document. Returning null means the document is not there after all.

      Parameters

      • context: unknown
      • documentId: string
      • range: PageRange

      Returns Promise<DocumentPages>

    • Passages matching a query, best first. Only ever called with document ids that list returned for the same context.

      Parameters

      Returns Promise<DocumentHit[]>