From 13ccf202de6678ecd5572027a2182e96da750247 Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Tue, 1 Aug 2023 17:33:51 -0500 Subject: [PATCH] [OpenSearch] : Fix AOSS Initialization (#8600) ### Description This PR fixes the AOSS Initialization in Opensearch. ### Maintainers @rlancemartin, @eyurtsev, @navneet1v Signed-off-by: Naveen Tatikonda --- .../langchain/vectorstores/opensearch_vector_search.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/langchain/langchain/vectorstores/opensearch_vector_search.py b/libs/langchain/langchain/vectorstores/opensearch_vector_search.py index 3276f92850..df76805852 100644 --- a/libs/langchain/langchain/vectorstores/opensearch_vector_search.py +++ b/libs/langchain/langchain/vectorstores/opensearch_vector_search.py @@ -336,13 +336,13 @@ class OpenSearchVectorSearch(VectorStore): opensearch_url: str, index_name: str, embedding_function: Embeddings, - is_aoss: bool, **kwargs: Any, ): """Initialize with necessary components.""" self.embedding_function = embedding_function self.index_name = index_name - self.is_aoss = is_aoss + http_auth = _get_kwargs_value(kwargs, "http_auth", None) + self.is_aoss = _is_aoss_enabled(http_auth=http_auth) self.client = _get_opensearch_client(opensearch_url, **kwargs) @property @@ -781,4 +781,4 @@ class OpenSearchVectorSearch(VectorStore): max_chunk_bytes=max_chunk_bytes, is_aoss=is_aoss, ) - return cls(opensearch_url, index_name, embedding, is_aoss, **kwargs) + return cls(opensearch_url, index_name, embedding, **kwargs)