Interface: Corpus<ChunkMetadata>
batteries/docs.Corpus
A corpus is a collection of documents that can be provided to an LLM to provide grounding for responses.
Type parameters
Name | Type |
---|---|
ChunkMetadata | extends Jsonifiable = Jsonifiable |
Hierarchy
Corpus
Implemented by
Properties
search
• search: (query
: string
, params?
: { limit?
: number
; score_threshold?
: number
}) => Promise
<ScoredChunk
<ChunkMetadata
>[]>
Type declaration
▸ (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
>[]>