{"version":3,"file":"clickhouse.d.cts","names":["EmbeddingsInterface","VectorStore","Document","ClickHouseLibArgs","Record","ColumnMap","ClickHouseFilter","ClickHouseStore","Promise"],"sources":["../../src/vectorstores/clickhouse.d.ts"],"sourcesContent":["import type { EmbeddingsInterface } from \"@langchain/core/embeddings\";\nimport { VectorStore } from \"@langchain/core/vectorstores\";\nimport { Document } from \"@langchain/core/documents\";\n/**\n * Arguments for the ClickHouseStore class, which include the host, port,\n * protocol, username, password, index type, index parameters,\n * index query params, column map, database, table.\n */\nexport interface ClickHouseLibArgs {\n    host: string;\n    port: string | number;\n    protocol?: string;\n    username: string;\n    password: string;\n    indexType?: string;\n    indexParam?: string | Record<string, number>;\n    indexQueryParams?: Record<string, string>;\n    columnMap?: ColumnMap;\n    database?: string;\n    table?: string;\n}\n/**\n * Mapping of columns in the ClickHouse database.\n */\nexport interface ColumnMap {\n    id: string;\n    uuid: string;\n    document: string;\n    embedding: string;\n    metadata: string;\n}\n/**\n * Type for filtering search results in the ClickHouse database.\n */\nexport interface ClickHouseFilter {\n    whereStr: string;\n}\n/**\n * Class for interacting with the ClickHouse database. It extends the\n * VectorStore class and provides methods for adding vectors and\n * documents, searching for similar vectors, and creating instances from\n * texts or documents.\n */\nexport declare class ClickHouseStore extends VectorStore {\n    FilterType: ClickHouseFilter;\n    private client;\n    private indexType;\n    private indexParam;\n    private indexQueryParams;\n    private columnMap;\n    private database;\n    private table;\n    private isInitialized;\n    _vectorstoreType(): string;\n    constructor(embeddings: EmbeddingsInterface, args: ClickHouseLibArgs);\n    /**\n     * Method to add vectors to the ClickHouse database.\n     * @param vectors The vectors to add.\n     * @param documents The documents associated with the vectors.\n     * @returns Promise that resolves when the vectors have been added.\n     */\n    addVectors(vectors: number[][], documents: Document[]): Promise<void>;\n    /**\n     * Method to add documents to the ClickHouse database.\n     * @param documents The documents to add.\n     * @returns Promise that resolves when the documents have been added.\n     */\n    addDocuments(documents: Document[]): Promise<void>;\n    /**\n     * Method to search for vectors that are similar to a given query vector.\n     * @param query The query vector.\n     * @param k The number of similar vectors to return.\n     * @param filter Optional filter for the search results.\n     * @returns Promise that resolves with an array of tuples, each containing a Document and a score.\n     */\n    similaritySearchVectorWithScore(query: number[], k: number, filter?: this[\"FilterType\"]): Promise<[Document, number][]>;\n    /**\n     * Static method to create an instance of ClickHouseStore from texts.\n     * @param texts The texts to use.\n     * @param metadatas The metadata associated with the texts.\n     * @param embeddings The embeddings to use.\n     * @param args The arguments for the ClickHouseStore.\n     * @returns Promise that resolves with a new instance of ClickHouseStore.\n     */\n    static fromTexts(texts: string[], metadatas: object | object[], embeddings: EmbeddingsInterface, args: ClickHouseLibArgs): Promise<ClickHouseStore>;\n    /**\n     * Static method to create an instance of ClickHouseStore from documents.\n     * @param docs The documents to use.\n     * @param embeddings The embeddings to use.\n     * @param args The arguments for the ClickHouseStore.\n     * @returns Promise that resolves with a new instance of ClickHouseStore.\n     */\n    static fromDocuments(docs: Document[], embeddings: EmbeddingsInterface, args: ClickHouseLibArgs): Promise<ClickHouseStore>;\n    /**\n     * Static method to create an instance of ClickHouseStore from an existing\n     * index.\n     * @param embeddings The embeddings to use.\n     * @param args The arguments for the ClickHouseStore.\n     * @returns Promise that resolves with a new instance of ClickHouseStore.\n     */\n    static fromExistingIndex(embeddings: EmbeddingsInterface, args: ClickHouseLibArgs): Promise<ClickHouseStore>;\n    private initialize;\n    /**\n     * Method to build an SQL query for inserting vectors and documents into\n     * the ClickHouse database.\n     * @param vectors The vectors to insert.\n     * @param documents The documents to insert.\n     * @returns The SQL query string.\n     */\n    private buildInsertQuery;\n    private escapeString;\n    /**\n     * Method to build an SQL query for searching for similar vectors in the\n     * ClickHouse database.\n     * @param query The query vector.\n     * @param k The number of similar vectors to return.\n     * @param filter Optional filter for the search results.\n     * @returns The SQL query string.\n     */\n    private buildSearchQuery;\n}\n//# sourceMappingURL=clickhouse.d.ts.map"],"mappings":";;;;;;;;AAQA;;;AASgBK,UATCF,iBAAAA,CASDE;EAAS,IAAA,EAAA,MAAA;EAORA,IAAAA,EAAAA,MAAS,GAAA,MAAA;EAUTC,QAAAA,CAAAA,EAAAA,MAAAA;EASIC,QAAAA,EAAAA,MAAAA;EACLD,QAAAA,EAAAA,MAAAA;EAUYN,SAAAA,CAAAA,EAAAA,MAAAA;EAA2BG,UAAAA,CAAAA,EAAAA,MAAAA,GAvC7BC,MAuC6BD,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAORD,gBAAAA,CAAAA,EA7CxBE,MA6CwBF,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAaM,SAAAA,CAAAA,EA5C5CH,SA4C4CG;EAMhCN,QAAAA,CAAAA,EAAAA,MAAAA;EAAaM,KAAAA,CAAAA,EAAAA,MAAAA;;;;;AAiB8FD,UA5DtHF,SAAAA,CA4DsHE;EAARC,EAAAA,EAAAA,MAAAA;EAQhGN,IAAAA,EAAAA,MAAAA;EAAwBF,QAAAA,EAAAA,MAAAA;EAA2BG,SAAAA,EAAAA,MAAAA;EAA4BI,QAAAA,EAAAA,MAAAA;;;;;AAQtBC,UAlEvEF,gBAAAA,CAkEuEE;EAzD3CP,QAAAA,EAAAA,MAAAA;AAAW;;;;;;;cAAnCM,eAAAA,SAAwBN,WAAAA;cAC7BK;;;;;;;;;;0BAUYN,2BAA2BG;;;;;;;6CAORD,aAAaM;;;;;;0BAMhCN,aAAaM;;;;;;;;4FAQqDA,SAASN;;;;;;;;;8EASvBF,2BAA2BG,oBAAoBK,QAAQD;;;;;;;;6BAQxGL,wBAAwBF,2BAA2BG,oBAAoBK,QAAQD;;;;;;;;uCAQrEP,2BAA2BG,oBAAoBK,QAAQD"}