DeepInfraEmbeddings
class utilizes the DeepInfra API to generate embeddings for given text inputs. This guide will walk you through the setup and usage of the DeepInfraEmbeddings
class, helping you integrate it into your project seamlessly.
@langchain/community
package as shown below:
DeepInfraEmbeddings
class, you need an API token from DeepInfra. You can pass this token directly to the constructor or set it as an environment variable (DEEPINFRA_API_TOKEN
).
DeepInfraEmbeddings
:
apiToken
is not provided, it will be read from the DEEPINFRA_API_TOKEN
environment variable.
embedQuery
method:
embedDocuments
method. This method will handle batching automatically based on the batchSize
parameter:
configuration
parameter:
DeepInfraEmbeddings
class: