@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 2.45 kB
Source Map (JSON)
{"version":3,"file":"gradient_ai.d.ts","names":["Embeddings","EmbeddingsParams","GradientEmbeddingsParams","GradientEmbeddings","Promise"],"sources":["../../src/embeddings/gradient_ai.d.ts"],"sourcesContent":["import { Embeddings, EmbeddingsParams } from \"@langchain/core/embeddings\";\n/**\n * Interface for GradientEmbeddings parameters. Extends EmbeddingsParams and\n * defines additional parameters specific to the GradientEmbeddings class.\n */\nexport interface GradientEmbeddingsParams extends EmbeddingsParams {\n /**\n * Gradient AI Access Token.\n * Provide Access Token if you do not wish to automatically pull from env.\n */\n gradientAccessKey?: string;\n /**\n * Gradient Workspace Id.\n * Provide workspace id if you do not wish to automatically pull from env.\n */\n workspaceId?: string;\n}\n/**\n * Class for generating embeddings using the Gradient AI's API. Extends the\n * Embeddings class and implements GradientEmbeddingsParams and\n */\nexport declare class GradientEmbeddings extends Embeddings implements GradientEmbeddingsParams {\n gradientAccessKey?: string;\n workspaceId?: string;\n batchSize: number;\n model: any;\n constructor(fields: GradientEmbeddingsParams);\n /**\n * Method to generate embeddings for an array of documents. Splits the\n * documents into batches and makes requests to the Gradient API to generate\n * embeddings.\n * @param texts Array of documents to generate embeddings for.\n * @returns Promise that resolves to a 2D array of embeddings for each document.\n */\n embedDocuments(texts: string[]): Promise<number[][]>;\n /**\n * Method to generate an embedding for a single document. Calls the\n * embedDocuments method with the document as the input.\n * @param text Document to generate an embedding for.\n * @returns Promise that resolves to an embedding for the document.\n */\n embedQuery(text: string): Promise<number[]>;\n /**\n * Method to set the model to use for generating embeddings.\n * @sets the class' `model` value to that of the retrieved Embeddings Model.\n */\n setModel(): Promise<void>;\n}\n//# sourceMappingURL=gradient_ai.d.ts.map"],"mappings":";;;;;;AAKA;AAgBA;AAKwBE,UArBPA,wBAAAA,SAAiCD,gBAqB1BC,CAAAA;EAQaE;;;;EAbiCF,iBAAAA,CAAAA,EAAAA,MAAAA;EAAwB;;;;;;;;;;cAAzEC,kBAAAA,SAA2BH,UAAAA,YAAsBE;;;;;sBAK9CA;;;;;;;;mCAQaE;;;;;;;4BAOPA;;;;;cAKdA"}