Class: LangchainCorpus<ChunkMetadata>
batteries/docs.LangchainCorpus
A Corpus backed by a LangChain VectorStore.
Type parameters
Name | Type |
---|---|
ChunkMetadata | extends Jsonifiable & Record <string , any > = Record <string , any > |
Implements
Corpus
<ChunkMetadata
>
Constructors
constructor
• new LangchainCorpus<ChunkMetadata
>(vectorStore
)
Type parameters
Name | Type |
---|---|
ChunkMetadata | extends Object = Record <string , any > |
Parameters
Name | Type |
---|---|
vectorStore | VectorStore |
Defined in
packages/ai-jsx/src/batteries/docs.tsx:673
Properties
vectorStore
• Readonly
vectorStore: VectorStore
Defined in
packages/ai-jsx/src/batteries/docs.tsx:673
Methods
search
▸ search(query
, params?
): Promise
<ScoredChunk
<ChunkMetadata
>[]>
Finds document chunks that are semantically similar to the provided query.
Parameters
Name | Type |
---|---|
query | string |
params? | Object |
params.limit? | number |
params.score_threshold? | number |
Returns
Promise
<ScoredChunk
<ChunkMetadata
>[]>