Loading...
Skip to main content

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

NameType
ChunkMetadataextends Jsonifiable = Jsonifiable

Hierarchy

Implemented by

Properties

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>[]>

Defined in

ai-jsx/src/batteries/docs.tsx:404