Databricks Lakehouse Platform unifies data, analytics, and AI on one platform.This guide provides a quick overview for getting started with Databricks embedding models. For detailed documentation of all
DatabricksEmbeddings
features and configurations head to the API reference.
Class | Package |
---|---|
DatabricksEmbeddings | databricks-langchain |
DatabricksEmbeddings
supports all methods of Embeddings
class including async APIs.
DatabricksEmbeddings
wraps must have OpenAI-compatible embedding input/output format (reference). As long as the input format is compatible, DatabricksEmbeddings
can be used for any endpoint type hosted on Databricks Model Serving:
DATABRICKS_HOST
and DATABRICKS_TOKEN
environment variables, respectively. See Authentication Documentation for how to get an access token.
databricks-langchain
package:
embeddings
object we initialized above. In this example, we will index and retrieve a sample document in the InMemoryVectorStore
.
embeddings.embed_documents(...)
and embeddings.embed_query(...)
to create embeddings for the text(s) used in from_texts
and retrieval invoke
operations, respectively.
You can directly call these methods to get embeddings for your own use cases.
embed_query
:
embed_documents
:
aembed_query
and aembed_documents
for producing embeddings asynchronously:
DatabricksEmbeddings
features and configuration options, please refer to the API reference.