from langchain_community.embeddings.openai import OpenAIEmbeddings
vs_client = VectorSearchClient()
vs_index = vs_client.get_index(
  endpoint_name="vs_endpoint",
  index_name="ml.llm.index"
)
vectorstore = DatabricksVectorSearch(
  index=vs_index,
  embedding=OpenAIEmbeddings(),
  text_column="document_content"
)
If you want to manage the documents ingestion/deletion yourself, you can use a
direct-access index.
Example
from langchain_community.vectorstores import DatabricksVectorSearch
from databricks.vector_search.client import VectorSearchClient
from langchain_community.embeddings.openai import OpenAIEmbeddings
vs_client = VectorSearchClient()
vs_index = vs_client.get_index(
  endpoint_name="vs_endpoint",
  index_name="ml.llm.index"
)
vectorstore = DatabricksVectorSearch(
  index=vs_index,
  embedding=OpenAIEmbeddings(),
  text_column="document_content"
)
vectorstore.add_texts(
  texts=["text1", "text2"]
)
For more information on Databricks Vector Search, see `Databricks Vector Search
documentation: https://docs.databricks.com/en/generative-ai/vector-search.html.
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__(index, *[, embedding, text_column, ...])
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.