{"version":3,"file":"singlestore.d.ts","names":["Pool","PoolOptions","EmbeddingsInterface","VectorStore","Document","DocumentInterface","Callbacks","Metadata","Record","DistanceMetrics","SearchStrategy","ConnectionOptions","ConnectionWithUri","ConnectionWithOptions","ConnectionConfig","SearchConfig","SingleStoreVectorStoreConfig","SingleStoreVectorStore","Promise"],"sources":["../../src/vectorstores/singlestore.d.ts"],"sourcesContent":["import type { Pool, PoolOptions } from \"mysql2/promise\";\nimport type { EmbeddingsInterface } from \"@langchain/core/embeddings\";\nimport { VectorStore } from \"@langchain/core/vectorstores\";\nimport { Document, DocumentInterface } from \"@langchain/core/documents\";\nimport { Callbacks } from \"@langchain/core/callbacks/manager\";\nexport type Metadata = Record<string, any>;\nexport type DistanceMetrics = \"DOT_PRODUCT\" | \"EUCLIDEAN_DISTANCE\";\nexport type SearchStrategy = \"VECTOR_ONLY\" | \"TEXT_ONLY\" | \"FILTER_BY_TEXT\" | \"FILTER_BY_VECTOR\" | \"WEIGHTED_SUM\";\nexport interface ConnectionOptions extends PoolOptions {\n}\ntype ConnectionWithUri = {\n    connectionOptions?: never;\n    connectionURI: string;\n};\ntype ConnectionWithOptions = {\n    connectionURI?: never;\n    connectionOptions: ConnectionOptions;\n};\ntype ConnectionConfig = ConnectionWithUri | ConnectionWithOptions;\ntype SearchConfig = {\n    searchStrategy?: SearchStrategy;\n    filterThreshold?: number;\n    textWeight?: number;\n    vectorWeight?: number;\n    vectorselectCountMultiplier?: number;\n};\nexport type SingleStoreVectorStoreConfig = ConnectionConfig & {\n    tableName?: string;\n    idColumnName?: string;\n    contentColumnName?: string;\n    vectorColumnName?: string;\n    metadataColumnName?: string;\n    distanceMetric?: DistanceMetrics;\n    useVectorIndex?: boolean;\n    vectorIndexName?: string;\n    vectorIndexOptions?: Metadata;\n    vectorSize?: number;\n    useFullTextIndex?: boolean;\n    searchConfig?: SearchConfig;\n};\n/**\n * Class for interacting with SingleStoreDB, a high-performance\n * distributed SQL database. It provides vector storage and vector\n * functions.\n */\nexport declare class SingleStoreVectorStore extends VectorStore {\n    connectionPool: Pool;\n    tableName: string;\n    idColumnName: string;\n    contentColumnName: string;\n    vectorColumnName: string;\n    metadataColumnName: string;\n    distanceMetric: DistanceMetrics;\n    useVectorIndex: boolean;\n    vectorIndexName: string;\n    vectorIndexOptions: Metadata;\n    vectorSize: number;\n    useFullTextIndex: boolean;\n    searchConfig: SearchConfig;\n    _vectorstoreType(): string;\n    constructor(embeddings: EmbeddingsInterface, config: SingleStoreVectorStoreConfig);\n    /**\n     * Creates a new table in the SingleStoreDB database if it does not\n     * already exist.\n     */\n    createTableIfNotExists(): Promise<void>;\n    /**\n     * Ends the connection to the SingleStoreDB database.\n     */\n    end(): Promise<void>;\n    /**\n     * Sets the search configuration for the SingleStoreVectorStore instance.\n     * @param config A SearchConfig object.\n     */\n    setSearchConfig(config: SearchConfig): Promise<void>;\n    /**\n     * Adds new documents to the SingleStoreDB database.\n     * @param documents An array of Document objects.\n     */\n    addDocuments(documents: Document[]): Promise<void>;\n    /**\n     * Adds new vectors to the SingleStoreDB database.\n     * @param vectors An array of vectors.\n     * @param documents An array of Document objects.\n     */\n    addVectors(vectors: number[][], documents: Document[]): Promise<void>;\n    /**\n     *\n     * Performs a similarity search on the texts stored in the SingleStoreDB\n     * using the specified search strategy and distance metric.\n     * @param query A string representing the query text.\n     * @param vector An array of numbers representing the query vector.\n     * @param k The number of nearest neighbors to return.\n     * @param filter Optional metadata to filter the texts by.\n     * @returns Top matching documents with score\n     */\n    similaritySearchTextAndVectorWithScore(query: string, vector: number[], k: number, filter?: Metadata): Promise<[Document, number][]>;\n    /**\n     * Performs a similarity search on the texts stored in the SingleStoreDB\n     * @param query A string representing the query text.\n     * @param k The number of nearest neighbors to return. By default, it is 4.\n     * @param filter Optional metadata to filter the texts by.\n     * @param _callbacks - Callbacks object, not used in this implementation.\n     * @returns Top matching documents\n     */\n    similaritySearch(query: string, k?: number, filter?: Metadata, _callbacks?: Callbacks | undefined): Promise<DocumentInterface<Metadata>[]>;\n    /**\n     * Performs a similarity search on the texts stored in the SingleStoreDB\n     * @param query A string representing the query text.\n     * @param k The number of nearest neighbors to return. By default, it is 4.\n     * @param filter Optional metadata to filter the texts by.\n     * @param _callbacks\n     * @returns Top matching documents with score\n     */\n    similaritySearchWithScore(query: string, k?: number, filter?: Metadata, _callbacks?: Callbacks | undefined): Promise<[DocumentInterface<Metadata>, number][]>;\n    /**\n     * Performs a similarity search on the vectors stored in the SingleStoreDB\n     * database.\n     * @param query An array of numbers representing the query vector.\n     * @param k The number of nearest neighbors to return.\n     * @param filter Optional metadata to filter the vectors by.\n     * @returns Top matching vectors with score\n     */\n    similaritySearchVectorWithScore(query: number[], k: number, filter?: Metadata): Promise<[Document, number][]>;\n    /**\n     * Creates a new instance of the SingleStoreVectorStore class from a list\n     * of texts.\n     * @param texts An array of strings.\n     * @param metadatas An array of metadata objects.\n     * @param embeddings An Embeddings object.\n     * @param dbConfig A SingleStoreVectorStoreConfig object.\n     * @returns A new SingleStoreVectorStore instance\n     */\n    static fromTexts(texts: string[], metadatas: object[], embeddings: EmbeddingsInterface, dbConfig: SingleStoreVectorStoreConfig): Promise<SingleStoreVectorStore>;\n    /**\n     * Creates a new instance of the SingleStoreVectorStore class from a list\n     * of Document objects.\n     * @param docs An array of Document objects.\n     * @param embeddings An Embeddings object.\n     * @param dbConfig A SingleStoreVectorStoreConfig object.\n     * @returns A new SingleStoreVectorStore instance\n     */\n    static fromDocuments(docs: Document[], embeddings: EmbeddingsInterface, dbConfig: SingleStoreVectorStoreConfig): Promise<SingleStoreVectorStore>;\n}\nexport {};\n//# sourceMappingURL=singlestore.d.ts.map"],"mappings":";;;;;;;KAKYO,QAAAA,GAAWC;KACXC,eAAAA;AADAF,KAEAG,cAAAA,GAFWF,aAAM,GAAA,WAAA,GAAA,gBAAA,GAAA,kBAAA,GAAA,cAAA;AACjBC,UAEKE,iBAAAA,SAA0BV,WAFhB,CAAA,CAC3B;AACA,KAEKW,iBAAAA,GAF6B;E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