indexify 0.2.28__tar.gz → 0.2.29__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.
Files changed (34) hide show
  1. {indexify-0.2.28 → indexify-0.2.29}/PKG-INFO +1 -1
  2. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/graph_definition.py +8 -0
  3. {indexify-0.2.28 → indexify-0.2.29}/indexify/http_client.py +4 -9
  4. {indexify-0.2.28 → indexify-0.2.29}/indexify/remote_graph.py +4 -3
  5. {indexify-0.2.28 → indexify-0.2.29}/pyproject.toml +1 -1
  6. {indexify-0.2.28 → indexify-0.2.29}/LICENSE.txt +0 -0
  7. {indexify-0.2.28 → indexify-0.2.29}/README.md +0 -0
  8. {indexify-0.2.28 → indexify-0.2.29}/indexify/__init__.py +0 -0
  9. {indexify-0.2.28 → indexify-0.2.29}/indexify/cli.py +0 -0
  10. {indexify-0.2.28 → indexify-0.2.29}/indexify/common_util.py +0 -0
  11. {indexify-0.2.28 → indexify-0.2.29}/indexify/data_loaders/__init__.py +0 -0
  12. {indexify-0.2.28 → indexify-0.2.29}/indexify/data_loaders/local_directory_loader.py +0 -0
  13. {indexify-0.2.28 → indexify-0.2.29}/indexify/data_loaders/url_loader.py +0 -0
  14. {indexify-0.2.28 → indexify-0.2.29}/indexify/error.py +0 -0
  15. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/agent.py +0 -0
  16. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/api_objects.py +0 -0
  17. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/downloader.py +0 -0
  18. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/executor_tasks.py +0 -0
  19. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/function_worker.py +0 -0
  20. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/image_dependency_installer.py +0 -0
  21. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/indexify_executor.py +0 -0
  22. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/runtime_probes.py +0 -0
  23. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/task_reporter.py +0 -0
  24. {indexify-0.2.28 → indexify-0.2.29}/indexify/executor/task_store.py +0 -0
  25. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/data_objects.py +0 -0
  26. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/graph.py +0 -0
  27. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/graph_validation.py +0 -0
  28. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/image.py +0 -0
  29. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/indexify_functions.py +0 -0
  30. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/local_cache.py +0 -0
  31. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/object_serializer.py +0 -0
  32. {indexify-0.2.28 → indexify-0.2.29}/indexify/functions_sdk/pipeline.py +0 -0
  33. {indexify-0.2.28 → indexify-0.2.29}/indexify/remote_pipeline.py +0 -0
  34. {indexify-0.2.28 → indexify-0.2.29}/indexify/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.2.28
3
+ Version: 0.2.29
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -49,3 +49,11 @@ class ComputeGraphMetadata(BaseModel):
49
49
 
50
50
  def get_input_payload_serializer(self):
51
51
  return get_serializer(self.start_node.compute_fn.encoder)
52
+
53
+ def get_input_encoder(self) -> str:
54
+ if self.start_node.compute_fn:
55
+ return self.start_node.compute_fn.encoder
56
+ elif self.start_node.dynamic_router:
57
+ return self.start_node.dynamic_router.encoder
58
+
59
+ raise ValueError("start node is not set on the graph")
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  import os
3
- from typing import Any, Dict, List, Optional, Union
3
+ from typing import Any, Dict, List, Optional
4
4
 
5
5
  import cloudpickle
6
6
  import httpx
@@ -13,11 +13,7 @@ from indexify.error import ApiException, GraphStillProcessing
13
13
  from indexify.functions_sdk.data_objects import IndexifyData
14
14
  from indexify.functions_sdk.graph import ComputeGraphMetadata, Graph
15
15
  from indexify.functions_sdk.indexify_functions import IndexifyFunction
16
- from indexify.functions_sdk.object_serializer import (
17
- CloudPickleSerializer,
18
- JsonSerializer,
19
- get_serializer,
20
- )
16
+ from indexify.functions_sdk.object_serializer import get_serializer
21
17
  from indexify.settings import DEFAULT_SERVICE_URL
22
18
 
23
19
 
@@ -276,11 +272,10 @@ class IndexifyClient:
276
272
  self,
277
273
  graph: str,
278
274
  block_until_done: bool = False,
279
- serializer: Union[
280
- CloudPickleSerializer, JsonSerializer
281
- ] = CloudPickleSerializer,
275
+ serializer: str = "cloudpickle",
282
276
  **kwargs,
283
277
  ) -> str:
278
+ serializer = get_serializer(serializer)
284
279
  ser_input = serializer.serialize(kwargs)
285
280
  params = {"block_until_finish": block_until_done}
286
281
  kwargs = {
@@ -1,6 +1,6 @@
1
1
  from typing import Any, List, Optional
2
2
 
3
- from indexify.functions_sdk.graph import Graph
3
+ from indexify.functions_sdk.graph import ComputeGraphMetadata, Graph
4
4
 
5
5
  from .http_client import IndexifyClient
6
6
  from .settings import DEFAULT_SERVICE_URL
@@ -30,6 +30,8 @@ class RemoteGraph:
30
30
  else:
31
31
  self._client = IndexifyClient(service_url=server_url)
32
32
 
33
+ self._graph_definition: ComputeGraphMetadata = self._client.graph(self._name)
34
+
33
35
  def run(self, block_until_done: bool = False, **kwargs) -> str:
34
36
  """
35
37
  Run the graph with the given inputs. The input is for the start function of the graph.
@@ -49,7 +51,7 @@ class RemoteGraph:
49
51
  return self._client.invoke_graph_with_object(
50
52
  self._name,
51
53
  block_until_done,
52
- self.graph.definition().get_input_payload_serializer(),
54
+ self._graph_definition.get_input_encoder(),
53
55
  **kwargs
54
56
  )
55
57
 
@@ -81,7 +83,6 @@ class RemoteGraph:
81
83
  :param client: The IndexifyClient used to communicate with the server.
82
84
  Prefered over server_url.
83
85
  """
84
- cls.graph = g
85
86
  if not client:
86
87
  client = IndexifyClient(service_url=server_url)
87
88
  client.register_compute_graph(g, additional_modules)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "indexify"
3
- version = "0.2.28"
3
+ version = "0.2.29"
4
4
  description = "Python Client for Indexify"
5
5
  authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
6
6
  license = "Apache 2.0"
File without changes
File without changes
File without changes
File without changes