Skip to main content

Class: LangchainCorpus<ChunkMetadata>

batteries/docs.LangchainCorpus

A Corpus backed by a LangChain VectorStore.

Type parameters

NameType
ChunkMetadataextends Jsonifiable & Record<string, any> = Record<string, any>

Implements

Constructors

constructor

new LangchainCorpus<ChunkMetadata>(vectorStore)

Type parameters

NameType
ChunkMetadataextends Object = Record<string, any>

Parameters

NameType
vectorStoreVectorStore

Defined in

packages/ai-jsx/src/batteries/docs.tsx:672

Properties

vectorStore

Readonly vectorStore: VectorStore

Defined in

packages/ai-jsx/src/batteries/docs.tsx:672

Methods

search(query, params?): Promise<ScoredChunk<ChunkMetadata>[]>

Finds document chunks that are semantically similar to the provided query.

Parameters

NameType
querystring
params?Object
params.limit?number
params.score_threshold?number

Returns

Promise<ScoredChunk<ChunkMetadata>[]>

Implementation of

Corpus.search

Defined in

packages/ai-jsx/src/batteries/docs.tsx:674