Optional
fields: Partial<TogetherAIEmbeddingsParams>The API key to use for the TogetherAI API.
{process.env.TOGETHER_AI_API_KEY}
The maximum number of documents to embed in a single request.
{512}
Model name to use
{"togethercomputer/m2-bert-80M-8k-retrieval"}
Model name to use
Alias for model
{"togethercomputer/m2-bert-80M-8k-retrieval"}
Whether to strip new lines from the input text. May not be suitable for all use cases.
{false}
Optional
timeoutTimeout to use when making requests to TogetherAI.
{undefined}
Method to generate embeddings for an array of documents. Splits the documents into batches and makes requests to the TogetherAI API to generate embeddings.
Array of documents to generate embeddings for.
Promise that resolves to a 2D array of embeddings for each document.
Generated using TypeDoc
Class for generating embeddings using the TogetherAI API. Extends the Embeddings class and implements TogetherAIEmbeddingsParams.
Example