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<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;
    getRelevantDocuments(query: string, config?: Callbacks | BaseCallbackConfig): Promise<DocumentInterface<Metadata>[]>;
    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, any, unknown>, options: Partial<RunnableConfig<Record<string, any>>>): AsyncGenerator<DocumentInterface<Metadata>[], any, unknown>;
}

Type Parameters

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

Hierarchy (view full)

Implemented by

Methods