Interface: LoadableCorpus<ChunkMetadata>
batteries/docs.LoadableCorpus
A LoadableCorpus is a Corpus that can additionally load and index documents.
Type parameters
Name | Type |
---|---|
ChunkMetadata | extends Jsonifiable = Jsonifiable |
Hierarchy
Corpus
<ChunkMetadata
>↳
LoadableCorpus
Properties
getStats
• getStats: () => CorpusStats
Type declaration
▸ (): CorpusStats
Returns
Defined in
ai-jsx/src/batteries/docs.tsx:450
load
• load: () => Promise
<CorpusStats
>
Type declaration
▸ (): Promise
<CorpusStats
>
Returns
Promise
<CorpusStats
>
Defined in
ai-jsx/src/batteries/docs.tsx:448
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
>[]>