DatabricksEmbeddings#

class langchain_community.embeddings.databricks.DatabricksEmbeddings[source]#

Bases: MlflowEmbeddings

Deprecated since version 0.3.3: Use :class:`~langchain_databricks.DatabricksEmbeddings` instead. It will be removed in None==1.0.

Databricks embeddings.

To use, you should have the mlflow python package installed. For more information, see https://mlflow.org/docs/latest/llms/deployments.

Example

from langchain_community.embeddings import DatabricksEmbeddings

embeddings = DatabricksEmbeddings(
    target_uri="databricks",
    endpoint="embeddings",
)
param documents_params: Dict[str, str] = {}#
param endpoint: str [Required]#

The endpoint to use.

param query_params: Dict[str, str] = {}#

The parameters to use for documents.

param target_uri: str = 'databricks'#

The target URI to use. Defaults to databricks.

async aembed_documents(texts: list[str]) list[list[float]]#

Asynchronous Embed search docs.

Parameters:

texts (list[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

list[list[float]]

async aembed_query(text: str) list[float]#

Asynchronous Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

list[float]

embed(texts: List[str], params: Dict[str, str]) List[List[float]]#
Parameters:
  • texts (List[str])

  • params (Dict[str, str])

Return type:

List[List[float]]

embed_documents(texts: List[str]) List[List[float]]#

Embed search docs.

Parameters:

texts (List[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

List[List[float]]

embed_query(text: str) List[float]#

Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

List[float]

Examples using DatabricksEmbeddings