UNPKG

mongodb-rag-core

Version:

Common elements used by MongoDB Chatbot Framework components.

45 lines 1.43 kB
import { Document, IndexDescription, MongoClient } from "mongodb"; export interface GetDatabaseMetadataParams { mongoClient: MongoClient; /** Name of the MongoDB database to use in queries. Currently, only one database is supported. */ databaseName: string; numSamplesPerCollection: number; latestDate?: Date; } type IndexDescriptionWithName = IndexDescription & { name: string; }; export interface CollectionInfo { /** Name of collection to use in queries. */ collectionName: string; description?: string; /** Information on indexes to apply to the collection. If you include the indexes, the system prompt will list the indexes along with the collection. */ indexes: IndexDescriptionWithName[]; /** Example documents to include in the system prompt. Truncated to fix within the context of the LLM. */ exampleDocuments: Document[]; /** Collection schema in JSON format. */ schema: Record<string, unknown>; } export interface DatabaseMetadata { databaseName: string; latestDate?: Date; description?: string; collections: CollectionInfo[]; } export declare function getDatabaseMetadata({ mongoClient, databaseName, numSamplesPerCollection, latestDate, }: GetDatabaseMetadataParams): Promise<DatabaseMetadata>; export {}; //# sourceMappingURL=getDatabaseMetadata.d.ts.map