Interface LibraryIndexOptions

What the index is made of.

interface LibraryIndexOptions {
    store: IVectorStore;
    collection: string;
    embed: ((texts, options?) => Promise<number[][]>);
    batchSize?: number;
}

Properties

collection: string
embed: ((texts, options?) => Promise<number[][]>)

One vector per text, in order: an answer of any other count fails the call, a search before it asks the store anything and indexSource before it writes the batch. The caller wires its model, its budget and its deadline. A search hands it the search's signal as options.signal, so a request in flight is cancelled with the search; indexing, and a search with no signal, pass no options.

Type declaration

    • (texts, options?): Promise<number[][]>
    • Parameters

      • texts: string[]
      • Optional options: {
            signal?: AbortSignal;
        }
        • Optional signal?: AbortSignal

      Returns Promise<number[][]>

batchSize?: number

How many passages one embed call and one upsert carry.

Default

64