llama-index-vector-stores-opensearch 0.1.11__tar.gz → 0.1.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of llama-index-vector-stores-opensearch might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-index-vector-stores-opensearch
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: llama-index vector_stores opensearch integration
5
5
  License: MIT
6
6
  Author: Your Name
@@ -20,6 +20,7 @@ from llama_index.core.vector_stores.utils import (
20
20
  node_to_metadata_dict,
21
21
  )
22
22
  from opensearchpy import AsyncOpenSearch
23
+ from opensearchpy.client import Client as OSClient
23
24
  from opensearchpy.exceptions import NotFoundError
24
25
  from opensearchpy.helpers import async_bulk
25
26
 
@@ -64,8 +65,10 @@ class OpensearchVectorClient:
64
65
  embedding_field: str = "embedding",
65
66
  text_field: str = "content",
66
67
  method: Optional[dict] = None,
68
+ engine: Optional[str] = "nmslib",
67
69
  max_chunk_bytes: int = 1 * 1024 * 1024,
68
70
  search_pipeline: Optional[str] = None,
71
+ os_client: Optional[OSClient] = None,
69
72
  **kwargs: Any,
70
73
  ):
71
74
  """Init params."""
@@ -73,7 +76,7 @@ class OpensearchVectorClient:
73
76
  method = {
74
77
  "name": "hnsw",
75
78
  "space_type": "l2",
76
- "engine": "nmslib",
79
+ "engine": engine,
77
80
  "parameters": {"ef_construction": 256, "m": 48},
78
81
  }
79
82
  if embedding_field is None:
@@ -102,7 +105,9 @@ class OpensearchVectorClient:
102
105
  }
103
106
  },
104
107
  }
105
- self._os_client = self._get_async_opensearch_client(self._endpoint, **kwargs)
108
+ self._os_client = os_client or self._get_async_opensearch_client(
109
+ self._endpoint, **kwargs
110
+ )
106
111
  not_found_error = self._import_not_found_error()
107
112
 
108
113
  event_loop = asyncio.get_event_loop()
@@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
27
27
  license = "MIT"
28
28
  name = "llama-index-vector-stores-opensearch"
29
29
  readme = "README.md"
30
- version = "0.1.11"
30
+ version = "0.1.12"
31
31
 
32
32
  [tool.poetry.dependencies]
33
33
  python = ">=3.8.1,<4.0"