@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 6.03 kB
Source Map (JSON)
{"version":3,"file":"myscale.d.cts","names":["EmbeddingsInterface","VectorStore","Document","MyScaleLibArgs","Record","ColumnMap","metric","MyScaleFilter","MyScaleStore","Promise"],"sources":["../../src/vectorstores/myscale.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 MyScaleStore class, which include the host, port,\n * protocol, username, password, index type, index parameters, column map,\n * database, table, and metric.\n */\nexport interface MyScaleLibArgs {\n host: string;\n port: string | number;\n protocol?: string;\n username: string;\n password: string;\n indexType?: string;\n indexParam?: Record<string, string>;\n columnMap?: ColumnMap;\n database?: string;\n table?: string;\n metric?: metric;\n}\n/**\n * Mapping of columns in the MyScale database.\n */\nexport interface ColumnMap {\n id: string;\n text: string;\n vector: string;\n metadata: string;\n}\n/**\n * Type of metric used in the MyScale database.\n */\nexport type metric = \"L2\" | \"Cosine\" | \"IP\";\n/**\n * Type for filtering search results in the MyScale database.\n */\nexport interface MyScaleFilter {\n whereStr: string;\n}\n/**\n * Class for interacting with the MyScale 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 MyScaleStore extends VectorStore {\n FilterType: MyScaleFilter;\n private client;\n private indexType;\n private indexParam;\n private columnMap;\n private database;\n private table;\n private metric;\n private isInitialized;\n _vectorstoreType(): string;\n constructor(embeddings: EmbeddingsInterface, args: MyScaleLibArgs);\n /**\n * Method to add vectors to the MyScale 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 MyScale 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 MyScaleStore 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 MyScaleStore.\n * @returns Promise that resolves with a new instance of MyScaleStore.\n */\n static fromTexts(texts: string[], metadatas: object | object[], embeddings: EmbeddingsInterface, args: MyScaleLibArgs): Promise<MyScaleStore>;\n /**\n * Static method to create an instance of MyScaleStore from documents.\n * @param docs The documents to use.\n * @param embeddings The embeddings to use.\n * @param args The arguments for the MyScaleStore.\n * @returns Promise that resolves with a new instance of MyScaleStore.\n */\n static fromDocuments(docs: Document[], embeddings: EmbeddingsInterface, args: MyScaleLibArgs): Promise<MyScaleStore>;\n /**\n * Static method to create an instance of MyScaleStore from an existing\n * index.\n * @param embeddings The embeddings to use.\n * @param args The arguments for the MyScaleStore.\n * @returns Promise that resolves with a new instance of MyScaleStore.\n */\n static fromExistingIndex(embeddings: EmbeddingsInterface, args: MyScaleLibArgs): Promise<MyScaleStore>;\n private initialize;\n /**\n * Method to build an SQL query for inserting vectors and documents into\n * the MyScale 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 * MyScale 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=myscale.d.ts.map"],"mappings":";;;;;;;;AAQA;;;AAWaM,UAXIH,cAAAA,CAWJG;EAAM,IAAA,EAAA,MAAA;EAKFD,IAAAA,EAAAA,MAAS,GAAA,MAAA;EASdC,QAAAA,CAAM,EAAA,MAAA;EAIDC,QAAAA,EAAAA,MAAa;EASTC,QAAAA,EAAAA,MAAY;EACjBD,SAAAA,CAAAA,EAAAA,MAAAA;EAUYP,UAAAA,CAAAA,EA1CXI,MA0CWJ,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAA2BG,SAAAA,CAAAA,EAzCvCE,SAyCuCF;EAORD,QAAAA,CAAAA,EAAAA,MAAAA;EAAaO,KAAAA,CAAAA,EAAAA,MAAAA;EAMhCP,MAAAA,CAAAA,EAnDfI,MAmDeJ;;;;;AAiB+EC,UA/D1FE,SAAAA,CA+D0FF;EAAyBK,EAAAA,EAAAA,MAAAA;EAARC,IAAAA,EAAAA,MAAAA;EAQ7FP,MAAAA,EAAAA,MAAAA;EAAwBF,QAAAA,EAAAA,MAAAA;;;;;AAQaG,KAtExDG,MAAAA,GAsEwDH,IAAAA,GAAAA,QAAAA,GAAAA,IAAAA;;;;AAzDf,UATpCI,aAAAA,CASoC;;;;;;;;;cAAhCC,YAAAA,SAAqBP,WAAAA;cAC1BM;;;;;;;;;;0BAUYP,2BAA2BG;;;;;;;6CAORD,aAAaO;;;;;;0BAMhCP,aAAaO;;;;;;;;4FAQqDA,SAASP;;;;;;;;;8EASvBF,2BAA2BG,iBAAiBM,QAAQD;;;;;;;;6BAQrGN,wBAAwBF,2BAA2BG,iBAAiBM,QAAQD;;;;;;;;uCAQlER,2BAA2BG,iBAAiBM,QAAQD"}