UNPKG

@langchain/core

Version:
1 lines 2.93 kB
{"version":3,"file":"embeddings.d.cts","names":["Embeddings","EmbeddingsParams","SyntheticEmbeddingsParams","SyntheticEmbeddings","Promise","FakeEmbeddings"],"sources":["../../../src/utils/testing/embeddings.d.ts"],"sourcesContent":["import { Embeddings, EmbeddingsParams } from \"../../embeddings.js\";\n/**\n * An interface that defines additional parameters specific to the\n * SyntheticEmbeddings class.\n */\ninterface SyntheticEmbeddingsParams extends EmbeddingsParams {\n vectorSize: number;\n}\n/**\n * A class that provides synthetic embeddings by overriding the\n * embedDocuments and embedQuery methods to generate embeddings based on\n * the input documents. The embeddings are generated by converting each\n * document into chunks, calculating a numerical value for each chunk, and\n * returning an array of these values as the embedding.\n */\nexport declare class SyntheticEmbeddings extends Embeddings implements SyntheticEmbeddingsParams {\n vectorSize: number;\n constructor(params?: SyntheticEmbeddingsParams);\n /**\n * Generates synthetic embeddings for a list of documents.\n * @param documents List of documents to generate embeddings for.\n * @returns A promise that resolves with a list of synthetic embeddings for each document.\n */\n embedDocuments(documents: string[]): Promise<number[][]>;\n /**\n * Generates a synthetic embedding for a document. The document is\n * converted into chunks, a numerical value is calculated for each chunk,\n * and an array of these values is returned as the embedding.\n * @param document The document to generate an embedding for.\n * @returns A promise that resolves with a synthetic embedding for the document.\n */\n embedQuery(document: string): Promise<number[]>;\n}\n/**\n * A class that provides fake embeddings by overriding the embedDocuments\n * and embedQuery methods to return fixed values.\n */\nexport declare class FakeEmbeddings extends Embeddings {\n constructor(params?: EmbeddingsParams);\n /**\n * Generates fixed embeddings for a list of documents.\n * @param documents List of documents to generate embeddings for.\n * @returns A promise that resolves with a list of fixed embeddings for each document.\n */\n embedDocuments(documents: string[]): Promise<number[][]>;\n /**\n * Generates a fixed embedding for a query.\n * @param _ The query to generate an embedding for.\n * @returns A promise that resolves with a fixed embedding for the query.\n */\n embedQuery(_: string): Promise<number[]>;\n}\nexport {};\n//# sourceMappingURL=embeddings.d.ts.map"],"mappings":";;;;;;AAAmE;AAenE;UAVUE,yBAAAA,SAAkCD,gBAYnBC,CAAAA;EAMgBE,UAAAA,EAAAA,MAAAA;;;;AARuD;AAsBhG;;;;AAA4CJ,cAtBvBG,mBAAAA,SAA4BH,UAAAA,YAAsBE,yBAsB3BF,CAAAA;EAAU,UAAA,EAAA,MAAA;uBApB7BE;;;;;;uCAMgBE;;;;;;;;gCAQPA;;;;;;cAMbC,cAAAA,SAAuBL,UAAAA;uBACnBC;;;;;;uCAMgBG;;;;;;yBAMdA"}