UNPKG

ai-utils.js

Version:

Build AI applications, chatbots, and agents with JavaScript and TypeScript.

12 lines (11 loc) 715 B
import { FunctionOptions } from "../model-function/FunctionOptions.js"; import { TextEmbeddingModel, TextEmbeddingModelSettings } from "../model-function/embed-text/TextEmbeddingModel.js"; import { TextChunk } from "../text-chunk/TextChunk.js"; import { VectorIndex } from "./VectorIndex.js"; export declare function upsertTextChunks<CHUNK extends TextChunk, SETTINGS extends TextEmbeddingModelSettings>({ vectorIndex, embeddingModel, generateId, chunks, ids, }: { vectorIndex: VectorIndex<CHUNK, unknown>; embeddingModel: TextEmbeddingModel<unknown, SETTINGS>; generateId?: () => string; chunks: CHUNK[]; ids?: Array<string | undefined>; }, options?: FunctionOptions<SETTINGS>): Promise<void>;