Optional
gradientGradient AI Access Token. Provide Access Token if you do not wish to automatically pull from env.
Optional
workspaceGradient Workspace Id. Provide workspace id if you do not wish to automatically pull from env.
Method to generate embeddings for an array of documents. Splits the documents into batches and makes requests to the Gradient API to generate embeddings.
Array of documents to generate embeddings for.
Promise that resolves to a 2D array of embeddings for each document.
Method to generate an embedding for a single document. Calls the embedDocuments method with the document as the input.
Document to generate an embedding for.
Promise that resolves to an embedding for the document.
Class for generating embeddings using the Gradient AI's API. Extends the Embeddings class and implements GradientEmbeddingsParams and