Interface BaseRetrieverInterface<Metadata>

Base interface implemented by all runnables. Used for cross-compatibility between different versions of LangChain core.

Should not change on patch releases.

interface BaseRetrieverInterface<Metadata> {
    batch(inputs: string[], options?: Partial<RunnableConfig> | Partial<RunnableConfig>[], batchOptions?: RunnableBatchOptions & {
        returnExceptions?: false;
    }): Promise<DocumentInterface<Metadata>[][]>;
    batch(inputs: string[], options?: Partial<RunnableConfig> | Partial<RunnableConfig>[], batchOptions?: RunnableBatchOptions & {
        returnExceptions: true;
    }): Promise<(Error | DocumentInterface<Metadata>[])[]>;
    batch(inputs: string[], options?: Partial<RunnableConfig> | Partial<RunnableConfig>[], batchOptions?: RunnableBatchOptions): Promise<(Error | DocumentInterface<Metadata>[])[]>;
    getName(suffix?: string): string;
    getRelevantDocuments(query: string, config?: BaseCallbackConfig | Callbacks): Promise<DocumentInterface<Metadata>[]>;
    invoke(input: string, options?: Partial<RunnableConfig>): Promise<DocumentInterface<Metadata>[]>;
    stream(input: string, options?: Partial<RunnableConfig>): Promise<IterableReadableStreamInterface<DocumentInterface<Metadata>[]>>;
    transform(generator: AsyncGenerator<string, any, unknown>, options: Partial<RunnableConfig>): AsyncGenerator<DocumentInterface<Metadata>[], any, unknown>;
}

Type Parameters

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

Hierarchy (view full)

Implemented by

Methods