DatabricksEmbeddings#

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

Bases: MlflowEmbeddings

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