Skip to content

Commit

Permalink
Init OpensearchVectorClient with os_async_client (#16767)
Browse files Browse the repository at this point in the history
  • Loading branch information
melya authored Oct 31, 2024
1 parent 4216c88 commit 4164d64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG — llama-index-vector-stores-opensearch

## [0.4.1]

- Added ability to create OpensearchVectorClient with custom os_async_client (like os_client)

## [0.2.2]

- Fixed issue where Opensearch Serverless does not support painless scripting so handling the case where is_aoss is set and using knn_score script instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class OpensearchVectorClient:
settings: Optional[dict]: Settings for the Opensearch index creation. Defaults to:
{"index": {"knn": True, "knn.algo_param.ef_search": 100}}
space_type (Optional[str]): space type for distance metric calculation. Defaults to: l2
os_client (Optional[OSClient]): Custom synchronous client (see OpenSearch from opensearch-py)
os_async_client (Optional[OSClient]): Custom asynchronous client (see AsyncOpenSearch from opensearch-py)
**kwargs: Optional arguments passed to the OpenSearch client from opensearch-py.
"""
Expand All @@ -74,6 +76,7 @@ def __init__(
max_chunk_bytes: int = 1 * 1024 * 1024,
search_pipeline: Optional[str] = None,
os_client: Optional[OSClient] = None,
os_async_client: Optional[OSClient] = None,
**kwargs: Any,
):
"""Init params."""
Expand Down Expand Up @@ -117,7 +120,7 @@ def __init__(
self._os_client = os_client or self._get_opensearch_client(
self._endpoint, **kwargs
)
self._os_async_client = self._get_async_opensearch_client(
self._os_async_client = os_async_client or self._get_async_opensearch_client(
self._endpoint, **kwargs
)
self._os_version = self._get_opensearch_version()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-vector-stores-opensearch"
readme = "README.md"
version = "0.4.0"
version = "0.4.1"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down

0 comments on commit 4164d64

Please sign in to comment.