UNPKG

mongodb-rag-core

Version:

Common elements used by MongoDB Chatbot Framework components.

50 lines 1.86 kB
import { DatabaseConnection } from "../DatabaseConnection"; import { EmbeddedContentStore } from "./EmbeddedContent"; import { MakeMongoDbDatabaseConnectionParams } from "../MongoDbDatabaseConnection"; export type MakeMongoDbEmbeddedContentStoreParams = MakeMongoDbDatabaseConnectionParams & { /** The name of the collection in the database that stores {@link EmbeddedContent} documents. @default "embedded_content" */ collectionName?: string; searchIndex: { /** Name of the search index to use for nearest-neighbor search. @default "vector_index" */ name?: string; /** Embedding field name. Stored in the `EmbeddedContent.embeddings[embeddingName]` field. */ embeddingName: string; /** Number of dimensions in the embedding field to index. Only used in index creation. @default 1536 */ numDimensions?: number; /** Atlas Vector Search filters to apply to the index creation. Only used in index creation. @default ```js [{ type: "filter", path: "sourceName" }] ``` */ filters?: { type: "filter"; path: string; }[]; }; }; export type MongoDbEmbeddedContentStore = EmbeddedContentStore & DatabaseConnection & { metadata: { databaseName: string; collectionName: string; embeddingPath: string; embeddingName: string; }; init(): Promise<void>; }; export declare function makeMongoDbEmbeddedContentStore({ connectionUri, databaseName, searchIndex: { embeddingName, numDimensions, filters, name, }, collectionName, }: MakeMongoDbEmbeddedContentStoreParams): MongoDbEmbeddedContentStore; //# sourceMappingURL=MongoDbEmbeddedContentStore.d.ts.map