indexify 0.2.14__tar.gz → 0.2.15__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.
- {indexify-0.2.14 → indexify-0.2.15}/PKG-INFO +1 -1
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/indexify_functions.py +4 -4
- {indexify-0.2.14 → indexify-0.2.15}/indexify/http_client.py +6 -8
- {indexify-0.2.14 → indexify-0.2.15}/pyproject.toml +1 -1
- {indexify-0.2.14 → indexify-0.2.15}/LICENSE.txt +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/README.md +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/__init__.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/cli.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/data_loaders/__init__.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/data_loaders/local_directory_loader.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/data_loaders/url_loader.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/error.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/agent.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/api_objects.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/downloader.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/executor_tasks.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/function_worker.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/indexify_executor.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/runtime_probes.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/task_reporter.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/executor/task_store.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/data_objects.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/graph.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/graph_definition.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/graph_validation.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/image.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/local_cache.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/object_serializer.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/functions_sdk/pipeline.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/remote_graph.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/remote_pipeline.py +0 -0
- {indexify-0.2.14 → indexify-0.2.15}/indexify/settings.py +0 -0
@@ -79,6 +79,10 @@ class IndexifyFunction(ABC):
|
|
79
79
|
|
80
80
|
return partial(self.run, **kwargs)
|
81
81
|
|
82
|
+
@classmethod
|
83
|
+
def deserialize_output(cls, output: IndexifyData) -> Any:
|
84
|
+
serializer = get_serializer(cls.payload_encoder)
|
85
|
+
return serializer.deserialize(output.payload)
|
82
86
|
|
83
87
|
class IndexifyRouter(ABC):
|
84
88
|
name: str = ""
|
@@ -265,7 +269,3 @@ class IndexifyFunctionWrapper:
|
|
265
269
|
payload = list(payload.values())[0]
|
266
270
|
return arg_type.model_validate(payload)
|
267
271
|
return payload
|
268
|
-
|
269
|
-
def deserialize_fn_output(self, output: IndexifyData) -> Any:
|
270
|
-
serializer = get_serializer(self.indexify_function.payload_encoder)
|
271
|
-
return serializer.deserialize(output.payload)
|
@@ -13,7 +13,7 @@ from rich import print
|
|
13
13
|
from indexify.error import ApiException
|
14
14
|
from indexify.functions_sdk.data_objects import IndexifyData
|
15
15
|
from indexify.functions_sdk.graph import ComputeGraphMetadata, Graph
|
16
|
-
from indexify.functions_sdk.indexify_functions import
|
16
|
+
from indexify.functions_sdk.indexify_functions import IndexifyFunction
|
17
17
|
from indexify.settings import DEFAULT_SERVICE_URL, DEFAULT_SERVICE_URL_HTTPS
|
18
18
|
|
19
19
|
|
@@ -71,7 +71,7 @@ class IndexifyClient:
|
|
71
71
|
self._service_url = service_url
|
72
72
|
self._timeout = kwargs.get("timeout")
|
73
73
|
self._graphs: Dict[str, Graph] = {}
|
74
|
-
self._fns = {}
|
74
|
+
self._fns: Dict[str, IndexifyFunction] = {}
|
75
75
|
|
76
76
|
def _request(self, method: str, **kwargs) -> httpx.Response:
|
77
77
|
try:
|
@@ -181,14 +181,12 @@ class IndexifyClient:
|
|
181
181
|
response = self._get(f"namespaces/{self.namespace}/compute_graphs/{name}")
|
182
182
|
return ComputeGraphMetadata(**response.json())
|
183
183
|
|
184
|
-
def
|
184
|
+
def load_fn(self, name: str, fn_name: str) -> IndexifyFunction:
|
185
185
|
response = self._get(
|
186
186
|
f"internal/namespaces/{self.namespace}/compute_graphs/{name}/code"
|
187
187
|
)
|
188
188
|
pickled_functions_by_name = cloudpickle.loads(response.content)
|
189
|
-
return
|
190
|
-
cloudpickle.loads(pickled_functions_by_name[fn_name])
|
191
|
-
)
|
189
|
+
return cloudpickle.loads(pickled_functions_by_name[fn_name])
|
192
190
|
|
193
191
|
def namespaces(self) -> List[str]:
|
194
192
|
response = self._get(f"namespaces")
|
@@ -323,7 +321,7 @@ class IndexifyClient:
|
|
323
321
|
"""
|
324
322
|
fn_key = f"{graph}/{fn_name}"
|
325
323
|
if fn_key not in self._fns:
|
326
|
-
self._fns[fn_key] = self.
|
324
|
+
self._fns[fn_key] = self.load_fn(graph, fn_name)
|
327
325
|
response = self._get(
|
328
326
|
f"namespaces/{self.namespace}/compute_graphs/{graph}/invocations/{invocation_id}/outputs",
|
329
327
|
)
|
@@ -335,7 +333,7 @@ class IndexifyClient:
|
|
335
333
|
indexify_data = self._download_output(
|
336
334
|
self.namespace, graph, invocation_id, fn_name, output.id
|
337
335
|
)
|
338
|
-
output = self._fns[fn_key].
|
336
|
+
output = self._fns[fn_key].deserialize_output(indexify_data)
|
339
337
|
outputs.append(output)
|
340
338
|
return outputs
|
341
339
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|