indexify 0.0.16__tar.gz → 0.0.17__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.0.16
3
+ Version: 0.0.17
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -45,7 +45,7 @@ class IndexifyClient:
45
45
 
46
46
  def __init__(
47
47
  self,
48
- service_url: str = DEFAULT_SERVICE_URL,
48
+ service_url: str = DEFAULT_SERVICE_URL, # switch this to DEFAULT_SERVICE_URL_HTTPS for TLS
49
49
  namespace: str = "default",
50
50
  config_path: Optional[str] = None,
51
51
  *args,
@@ -489,7 +489,7 @@ class IndexifyClient:
489
489
  response.raise_for_status()
490
490
  return response.json().get("metadata",[])
491
491
 
492
- def search_index(self, name: str, query: str, top_k: int, filters: List[str] = None) -> list[TextChunk]:
492
+ def search_index(self, name: str, query: str, top_k: int, filters: List[str] = []) -> list[TextChunk]:
493
493
  """
494
494
  Search index in the current namespace.
495
495
 
@@ -499,8 +499,6 @@ class IndexifyClient:
499
499
  - top_k (int): top k nearest neighbors to be returned
500
500
  - filters (List[str]): list of filters to apply
501
501
  """
502
- if filters is None:
503
- filters = []
504
502
  req = {"index": name, "query": query, "k": top_k, "filters": filters}
505
503
  response = self.post(
506
504
  f"namespaces/{self.namespace}/search",
@@ -510,7 +508,7 @@ class IndexifyClient:
510
508
  response.raise_for_status()
511
509
  return response.json()["results"]
512
510
 
513
- def upload_file(self, path: str, id=None, labels: dict = {}):
511
+ def upload_file(self, path: str, id=None, labels: dict = {}) -> str:
514
512
  """
515
513
  Upload a file.
516
514
 
@@ -530,6 +528,8 @@ class IndexifyClient:
530
528
  timeout=None,
531
529
  )
532
530
  response.raise_for_status()
531
+ response_json = response.json()
532
+ return response_json["content_id"]
533
533
 
534
534
  def list_schemas(self) -> List[str]:
535
535
  """
@@ -0,0 +1,2 @@
1
+ DEFAULT_SERVICE_URL = "http://localhost:8900"
2
+ DEFAULT_SERVICE_URL_HTTPS = "https://localhost:8900"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "indexify"
3
- version = "0.0.16"
3
+ version = "0.0.17"
4
4
  description = "Python Client for Indexify"
5
5
  authors = ["Diptanu Gon Choudhury <diptanuc@gmail.com>", "Vijay Parthasarathy <vijay2win@gmail.com>"]
6
6
  license = "Apache 2.0"
@@ -1 +0,0 @@
1
- DEFAULT_SERVICE_URL = "http://localhost:8900"
File without changes
File without changes
File without changes
File without changes