Constructor for the DeepInfraEmbeddings class.
Optional
fields: Partial<DeepInfraEmbeddingsParams> & { verbose?: boolean }An optional object with properties to configure the instance.
The API token to use for authentication.
If not provided, it will be read from the DEEPINFRA_API_TOKEN
environment variable.
The maximum number of texts to embed in a single request. This is limited by the DeepInfra API to a maximum of 1024.
The model ID to use for generating completions.
Default: sentence-transformers/clip-ViT-B-32
Generates embeddings for an array of texts.
An array of strings to generate embeddings for.
A Promise that resolves to an array of embeddings.
Generates an embedding for a single text.
A string to generate an embedding for.
A Promise that resolves to an array of numbers representing the embedding.
A class for generating embeddings using the DeepInfra API.
Example