llama-index-vector-stores-opensearch 0.5.3__py3-none-any.whl → 0.5.4__py3-none-any.whl

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.

@@ -348,7 +348,8 @@ class OpensearchVectorClient:
348
348
  return query
349
349
 
350
350
  def _is_text_field(self, value: Any) -> bool:
351
- """Check if value is a string and keyword filtering needs to be performed.
351
+ """
352
+ Check if value is a string and keyword filtering needs to be performed.
352
353
 
353
354
  Not applied to datetime strings.
354
355
  """
@@ -362,7 +363,8 @@ class OpensearchVectorClient:
362
363
  return False
363
364
 
364
365
  def _parse_filter(self, filter: MetadataFilter) -> dict:
365
- """Parse a single MetadataFilter to equivalent OpenSearch expression.
366
+ """
367
+ Parse a single MetadataFilter to equivalent OpenSearch expression.
366
368
 
367
369
  As Opensearch does not differentiate between scalar/array keyword fields, IN and ANY are equivalent.
368
370
  """
@@ -464,6 +466,7 @@ class OpensearchVectorClient:
464
466
 
465
467
  Returns:
466
468
  Dict: Up to k documents closest to query_embedding.
469
+
467
470
  """
468
471
  filters = self._parse_filters(filters)
469
472
 
@@ -553,7 +556,8 @@ class OpensearchVectorClient:
553
556
  def __get_painless_scripting_source(
554
557
  self, space_type: str, vector_field: str = "embedding"
555
558
  ) -> str:
556
- """For Painless Scripting, it returns the script source based on space type.
559
+ """
560
+ For Painless Scripting, it returns the script source based on space type.
557
561
  This does not work with Opensearch Serverless currently.
558
562
  """
559
563
  source_value = (
@@ -594,7 +598,8 @@ class OpensearchVectorClient:
594
598
  pre_filter: Optional[Union[Dict, List]] = None,
595
599
  vector_field: str = "embedding",
596
600
  ) -> Dict:
597
- """For Scoring Script Search, this is the default query. Has to account for Opensearch Service
601
+ """
602
+ For Scoring Script Search, this is the default query. Has to account for Opensearch Service
598
603
  Serverless which does not support painless scripting functions so defaults to knn_score.
599
604
  """
600
605
  if not pre_filter:
@@ -625,13 +630,7 @@ class OpensearchVectorClient:
625
630
 
626
631
  def _is_aoss_enabled(self, http_auth: Any) -> bool:
627
632
  """Check if the service is http_auth is set as `aoss`."""
628
- if (
629
- http_auth is not None
630
- and hasattr(http_auth, "service")
631
- and http_auth.service == "aoss"
632
- ):
633
- return True
634
- return False
633
+ return http_auth is not None and hasattr(http_auth, "service") and http_auth.service == "aoss"
635
634
 
636
635
  def _is_efficient_filtering_enabled(self) -> bool:
637
636
  """Check if kNN with efficient filtering is enabled."""
@@ -704,6 +703,7 @@ class OpensearchVectorClient:
704
703
 
705
704
  Args:
706
705
  doc_id (str): a LlamaIndex `Document` id
706
+
707
707
  """
708
708
  search_query = {
709
709
  "query": {"term": {"metadata.doc_id.keyword": {"value": doc_id}}}
@@ -718,6 +718,7 @@ class OpensearchVectorClient:
718
718
 
719
719
  Args:
720
720
  doc_id (str): a LlamaIndex `Document` id
721
+
721
722
  """
722
723
  search_query = {
723
724
  "query": {"term": {"metadata.doc_id.keyword": {"value": doc_id}}}
@@ -732,11 +733,13 @@ class OpensearchVectorClient:
732
733
  filters: Optional[MetadataFilters] = None,
733
734
  **delete_kwargs: Any,
734
735
  ) -> None:
735
- """Deletes nodes.
736
+ """
737
+ Deletes nodes.
736
738
 
737
739
  Args:
738
740
  node_ids (Optional[List[str]], optional): IDs of nodes to delete. Defaults to None.
739
741
  filters (Optional[MetadataFilters], optional): Metadata filters. Defaults to None.
742
+
740
743
  """
741
744
  if not node_ids and not filters:
742
745
  return
@@ -756,11 +759,13 @@ class OpensearchVectorClient:
756
759
  filters: Optional[MetadataFilters] = None,
757
760
  **delete_kwargs: Any,
758
761
  ) -> None:
759
- """Deletes nodes.
762
+ """
763
+ Deletes nodes.
760
764
 
761
765
  Args:
762
766
  node_ids (Optional[List[str]], optional): IDs of nodes to delete. Defaults to None.
763
767
  filters (Optional[MetadataFilters], optional): Metadata filters. Defaults to None.
768
+
764
769
  """
765
770
  if not node_ids and not filters:
766
771
  return
@@ -896,7 +901,6 @@ class OpensearchVectorClient:
896
901
  start_char_idx=start_char_idx,
897
902
  end_char_idx=end_char_idx,
898
903
  relationships=relationships,
899
- extra_info=source,
900
904
  )
901
905
  ids.append(node_id)
902
906
  nodes.append(node)
@@ -941,6 +945,7 @@ class OpensearchVectorStore(BasePydanticVectorStore):
941
945
  # initialize vector store
942
946
  vector_store = OpensearchVectorStore(client)
943
947
  ```
948
+
944
949
  """
945
950
 
946
951
  stores_text: bool = True
@@ -1015,11 +1020,13 @@ class OpensearchVectorStore(BasePydanticVectorStore):
1015
1020
  filters: Optional[MetadataFilters] = None,
1016
1021
  **delete_kwargs: Any,
1017
1022
  ) -> None:
1018
- """Deletes nodes async.
1023
+ """
1024
+ Deletes nodes async.
1019
1025
 
1020
1026
  Args:
1021
1027
  node_ids (Optional[List[str]], optional): IDs of nodes to delete. Defaults to None.
1022
1028
  filters (Optional[MetadataFilters], optional): Metadata filters. Defaults to None.
1029
+
1023
1030
  """
1024
1031
  self._client.delete_nodes(node_ids, filters, **delete_kwargs)
1025
1032
 
@@ -1029,11 +1036,13 @@ class OpensearchVectorStore(BasePydanticVectorStore):
1029
1036
  filters: Optional[MetadataFilters] = None,
1030
1037
  **delete_kwargs: Any,
1031
1038
  ) -> None:
1032
- """Async deletes nodes async.
1039
+ """
1040
+ Async deletes nodes async.
1033
1041
 
1034
1042
  Args:
1035
1043
  node_ids (Optional[List[str]], optional): IDs of nodes to delete. Defaults to None.
1036
1044
  filters (Optional[MetadataFilters], optional): Metadata filters. Defaults to None.
1045
+
1037
1046
  """
1038
1047
  await self._client.adelete_nodes(node_ids, filters, **delete_kwargs)
1039
1048
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-vector-stores-opensearch
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: llama-index vector_stores opensearch integration
5
5
  Author-email: Your Name <you@example.com>
6
6
  License-Expression: MIT
@@ -0,0 +1,7 @@
1
+ llama_index/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ llama_index/vector_stores/opensearch/__init__.py,sha256=U1_XAkZb6zcskOk4s10NB8Tjs9AZRGdRQLzOGpbWdBA,176
3
+ llama_index/vector_stores/opensearch/base.py,sha256=a9sBDrpdrPzFqW0ptULnVFcGwVESpbNuQttzoNgliQM,38213
4
+ llama_index_vector_stores_opensearch-0.5.4.dist-info/METADATA,sha256=cETjJH4xwguGQ8TPJE0Gmx0VYAYsh_911MaYzPyzqBs,438
5
+ llama_index_vector_stores_opensearch-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ llama_index_vector_stores_opensearch-0.5.4.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
7
+ llama_index_vector_stores_opensearch-0.5.4.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- llama_index/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- llama_index/vector_stores/opensearch/__init__.py,sha256=U1_XAkZb6zcskOk4s10NB8Tjs9AZRGdRQLzOGpbWdBA,176
3
- llama_index/vector_stores/opensearch/base.py,sha256=I5zfrio1kTn1YbvtGtx0hTnStsPArhh85treEC_DqHE,38262
4
- llama_index_vector_stores_opensearch-0.5.3.dist-info/METADATA,sha256=qKYip28sqdaE47NWwAYmzS3bQ48U5eXJFIbpEplVLxs,438
5
- llama_index_vector_stores_opensearch-0.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- llama_index_vector_stores_opensearch-0.5.3.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
7
- llama_index_vector_stores_opensearch-0.5.3.dist-info/RECORD,,