Skip to main content

Interface: LoadableCorpus<ChunkMetadata>

batteries/docs.LoadableCorpus

A LoadableCorpus is a Corpus that can additionally load and index documents.

Type parameters

NameType
ChunkMetadataextends Jsonifiable = Jsonifiable

Hierarchy

  • Corpus<ChunkMetadata>

    LoadableCorpus

Properties

getStats

getStats: () => CorpusStats

Type declaration

▸ (): CorpusStats

Returns

CorpusStats

Defined in

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


load

load: () => Promise<CorpusStats>

Type declaration

▸ (): Promise<CorpusStats>

Returns

Promise<CorpusStats>

Defined in

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


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
NameType
querystring
params?Object
params.limit?number
params.score_threshold?number
Returns

Promise<ScoredChunk<ChunkMetadata>[]>

Inherited from

Corpus.search

Defined in

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