langchain.js
    Preparing search index...

    Interface BaseRetrieverInterface<Metadata>

    Interface for a base retriever that defines core functionality for retrieving relevant documents from a source based on a query.

    The BaseRetrieverInterface standardizes the getRelevantDocuments method, enabling retrieval of documents that match the query criteria.

    interface BaseRetrieverInterface<
        Metadata extends Record<string, any> = Record<string, any>,
    > {
        lc_serializable: boolean;
        get lc_id(): string[];
        batch(
            inputs: string[],
            options?:
                | Partial<RunnableConfig<Record<string, any>>>
                | Partial<RunnableConfig<Record<string, any>>>[],
            batchOptions?: RunnableBatchOptions & { returnExceptions?: false },
        ): Promise<DocumentInterface<Metadata>[][]>;
        batch(
            inputs: string[],
            options?:
                | Partial<RunnableConfig<Record<string, any>>>
                | Partial<RunnableConfig<Record<string, any>>>[],
            batchOptions?: RunnableBatchOptions & { returnExceptions: true },
        ): Promise<(Error | DocumentInterface<Metadata>[])[]>;
        batch(
            inputs: string[],
            options?:
                | Partial<RunnableConfig<Record<string, any>>>
                | Partial<RunnableConfig<Record<string, any>>>[],
            batchOptions?: RunnableBatchOptions,
        ): Promise<(Error | DocumentInterface<Metadata>[])[]>;
        getName(suffix?: string): string;
        invoke(
            input: string,
            options?: Partial<RunnableConfig<Record<string, any>>>,
        ): Promise<DocumentInterface<Metadata>[]>;
        stream(
            input: string,
            options?: Partial<RunnableConfig<Record<string, any>>>,
        ): Promise<IterableReadableStreamInterface<DocumentInterface<Metadata>[]>>;
        transform(
            generator: AsyncGenerator<string>,
            options: Partial<CallOptions>,
        ): AsyncGenerator<DocumentInterface<Metadata>[]>;
    }

    Type Parameters

    • Metadata extends Record<string, any> = Record<string, any>

      The type of metadata associated with each document, defaulting to Record<string, any>.

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    lc_serializable: boolean

    Accessors

    • get lc_id(): string[]

      Returns string[]

    Methods

    • Parameters

      • Optionalsuffix: string

      Returns string