Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Arguments for DatabricksVectorSearch #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ class DatabricksVectorSearch(VectorStore):
Make sure the text column specified is in the index.
columns: The list of column names to get when doing the search.
Defaults to ``[primary_key, text_column]``.
client_args: Additional arguments to pass to the VectorSearchClient.
Allows you to pass in values like `service_principal_client_id`
and `service_principal_client_secret` for to allow for
service principal authentication instead of personal access token authentication.

Instantiate:

Expand Down Expand Up @@ -212,6 +216,7 @@ def __init__(
embedding: Optional[Embeddings] = None,
text_column: Optional[str] = None,
columns: Optional[List[str]] = None,
client_args: Optional[Dict[str, Any]] = None,
):
if not (isinstance(index_name, str) and _INDEX_NAME_PATTERN.match(index_name)):
raise ValueError(
Expand All @@ -230,7 +235,7 @@ def __init__(
) from e

try:
self.index = VectorSearchClient().get_index(
self.index = VectorSearchClient(**client_args).get_index(
endpoint_name=endpoint, index_name=index_name
)
except Exception as e:
Expand Down