modAL 1.2.2.dev31__tar.gz → 1.2.2.dev32__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.
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/PKG-INFO +1 -1
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_functions.py +13 -20
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_object.py +4 -4
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/client.pyi +2 -2
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/functions.pyi +6 -7
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_version/__init__.py +1 -1
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/LICENSE +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/README.md +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/__main__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_billing.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_clustered_functions.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_clustered_functions.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_container_entrypoint.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_grpc_client.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_ipython.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_load_context.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_location.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_output.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_partial_function.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_pty.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_resolver.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_resources.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/asgi.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/execution_context.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/telemetry.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_serialization.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_traceback.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_tunnel.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_tunnel.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_type_manager.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/app_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/async_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/blob_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/deprecation.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/docker_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/function_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/git_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/hash_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/http_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/logger.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/mount_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/name_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/package_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/shell_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/task_command_router_client.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_utils/time_utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_vendor/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_vendor/tblib.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/_watcher.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/app.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/app.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/billing.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/2023.12.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/2024.04.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/2024.10.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/2025.06.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/README.md +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/builder/base-images.json +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/call_graph.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/_download.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/_traceback.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/app.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/cluster.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/config.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/container.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/dict.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/entry_point.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/environment.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/import_refs.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/launch.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/network_file_system.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/profile.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/programs/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/programs/launch_instance_ssh.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/programs/run_marimo.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/programs/vscode.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/queues.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/run.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/secret.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/token.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/utils.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cli/volume.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/client.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cls.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/cls.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/config.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/container_process.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/container_process.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/dict.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/dict.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/environments.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/environments.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/exception.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/experimental/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/experimental/flash.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/experimental/flash.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/experimental/ipython.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/file_io.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/file_io.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/file_pattern_matcher.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/functions.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/gpu.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/image.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/image.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/io_streams.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/io_streams.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/mount.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/mount.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/network_file_system.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/network_file_system.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/object.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/object.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/output.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/parallel_map.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/parallel_map.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/partial_function.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/partial_function.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/proxy.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/proxy.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/py.typed +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/queue.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/queue.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/retries.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/runner.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/runner.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/running_app.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/sandbox.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/sandbox.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/schedule.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/scheduler_placement.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/secret.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/secret.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/serving.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/serving.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/snapshot.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/snapshot.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/stream_type.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/token_flow.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/token_flow.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/volume.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal/volume.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal.egg-info/requires.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal.egg-info/top_level.txt +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_docs/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/__init__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/api.proto +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/api_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/api_pb2.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/api_pb2.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/py.typed +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/sandbox_router.proto +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/sandbox_router_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/sandbox_router_pb2.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/sandbox_router_pb2.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/sandbox_router_pb2_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/sandbox_router_pb2_grpc.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/task_command_router.proto +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/modal_version/__main__.py +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/pyproject.toml +0 -0
- {modal-1.2.2.dev31 → modal-1.2.2.dev32}/setup.cfg +0 -0
|
@@ -1671,8 +1671,8 @@ Use the `Function.get_web_url()` method instead.
|
|
|
1671
1671
|
input_queue,
|
|
1672
1672
|
self.client,
|
|
1673
1673
|
)
|
|
1674
|
-
|
|
1675
|
-
fc
|
|
1674
|
+
fc: _FunctionCall[ReturnType] = _FunctionCall._new_hydrated(function_call_id, self.client, None)
|
|
1675
|
+
fc._num_inputs = num_inputs # set the cached value of num_inputs
|
|
1676
1676
|
return fc
|
|
1677
1677
|
|
|
1678
1678
|
async def _call_function(self, args, kwargs) -> ReturnType:
|
|
@@ -1941,19 +1941,16 @@ class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefix="fc"):
|
|
|
1941
1941
|
def _invocation(self):
|
|
1942
1942
|
return _Invocation(self.client.stub, self.object_id, self.client)
|
|
1943
1943
|
|
|
1944
|
-
def _hydrate_metadata(self, metadata: Optional[Message]):
|
|
1945
|
-
if not metadata:
|
|
1946
|
-
return
|
|
1947
|
-
assert isinstance(metadata, api_pb2.FunctionCallFromIdResponse)
|
|
1948
|
-
self._num_inputs = metadata.num_inputs
|
|
1949
|
-
|
|
1950
1944
|
@live_method
|
|
1951
1945
|
async def num_inputs(self) -> int:
|
|
1952
1946
|
"""Get the number of inputs in the function call."""
|
|
1953
|
-
|
|
1954
|
-
|
|
1947
|
+
if self._num_inputs is None:
|
|
1948
|
+
request = api_pb2.FunctionCallFromIdRequest(function_call_id=self.object_id)
|
|
1949
|
+
resp = await self.client.stub.FunctionCallFromId(request)
|
|
1950
|
+
self._num_inputs = resp.num_inputs # cached
|
|
1955
1951
|
return self._num_inputs
|
|
1956
1952
|
|
|
1953
|
+
@live_method
|
|
1957
1954
|
async def get(self, timeout: Optional[float] = None, *, index: int = 0) -> ReturnType:
|
|
1958
1955
|
"""Get the result of the index-th input of the function call.
|
|
1959
1956
|
`.spawn()` calls have a single output, so only specifying `index=0` is valid.
|
|
@@ -1997,6 +1994,7 @@ class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefix="fc"):
|
|
|
1997
1994
|
async for _, item in self._invocation().enumerate(start_index=start, end_index=end):
|
|
1998
1995
|
yield item
|
|
1999
1996
|
|
|
1997
|
+
@live_method
|
|
2000
1998
|
async def get_call_graph(self) -> list[InputInfo]:
|
|
2001
1999
|
"""Returns a structure representing the call graph from a given root
|
|
2002
2000
|
call ID, along with the status of execution for each node.
|
|
@@ -2009,6 +2007,7 @@ class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefix="fc"):
|
|
|
2009
2007
|
response = await self._client.stub.FunctionGetCallGraph(request)
|
|
2010
2008
|
return _reconstruct_call_graph(response)
|
|
2011
2009
|
|
|
2010
|
+
@live_method
|
|
2012
2011
|
async def cancel(
|
|
2013
2012
|
self,
|
|
2014
2013
|
# if true, containers running the inputs are forcibly terminated
|
|
@@ -2050,21 +2049,15 @@ class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefix="fc"):
|
|
|
2050
2049
|
async def _load(
|
|
2051
2050
|
self: _FunctionCall, resolver: Resolver, load_context: LoadContext, existing_object_id: Optional[str]
|
|
2052
2051
|
):
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
self._hydrate(function_call_id, load_context.client, resp)
|
|
2052
|
+
# this loader doesn't do anything in practice, but it will get the client from the load_context
|
|
2053
|
+
self._hydrate(function_call_id, load_context.client, None)
|
|
2056
2054
|
|
|
2057
2055
|
rep = f"FunctionCall.from_id({function_call_id!r})"
|
|
2058
|
-
|
|
2056
|
+
|
|
2057
|
+
return _FunctionCall._from_loader(
|
|
2059
2058
|
_load, rep, hydrate_lazily=True, load_context_overrides=LoadContext(client=client)
|
|
2060
2059
|
)
|
|
2061
2060
|
|
|
2062
|
-
# TODO(elias): Remove these
|
|
2063
|
-
# We already know the object ID, so we can set it directly
|
|
2064
|
-
fc._object_id = function_call_id
|
|
2065
|
-
fc._client = client
|
|
2066
|
-
return fc
|
|
2067
|
-
|
|
2068
2061
|
@staticmethod
|
|
2069
2062
|
async def gather(*function_calls: "_FunctionCall[T]") -> typing.Sequence[T]:
|
|
2070
2063
|
"""Wait until all Modal FunctionCall objects have results before returning.
|
|
@@ -310,19 +310,19 @@ class _Object:
|
|
|
310
310
|
logger.debug(f"rehydrating {self} after snapshot")
|
|
311
311
|
self._is_hydrated = False # un-hydrate and re-resolve
|
|
312
312
|
# Set the client on LoadContext before loading
|
|
313
|
-
|
|
313
|
+
root_load_context = LoadContext(client=client)
|
|
314
314
|
resolver = Resolver()
|
|
315
|
-
await resolver.load(typing.cast(_Object, self),
|
|
315
|
+
await resolver.load(typing.cast(_Object, self), root_load_context)
|
|
316
316
|
self._is_rehydrated = True
|
|
317
317
|
logger.debug(f"rehydrated {self} with client {id(self.client)}")
|
|
318
318
|
elif not self._hydrate_lazily:
|
|
319
319
|
self._validate_is_hydrated()
|
|
320
320
|
else:
|
|
321
321
|
# Set the client on LoadContext before loading
|
|
322
|
-
|
|
322
|
+
root_load_context = LoadContext(client=client)
|
|
323
323
|
resolver = Resolver()
|
|
324
324
|
with suppress_tb_frames(1): # skip this frame by default
|
|
325
|
-
await resolver.load(self,
|
|
325
|
+
await resolver.load(self, root_load_context)
|
|
326
326
|
return self
|
|
327
327
|
|
|
328
328
|
|
|
@@ -33,7 +33,7 @@ class _Client:
|
|
|
33
33
|
server_url: str,
|
|
34
34
|
client_type: int,
|
|
35
35
|
credentials: typing.Optional[tuple[str, str]],
|
|
36
|
-
version: str = "1.2.2.
|
|
36
|
+
version: str = "1.2.2.dev32",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -164,7 +164,7 @@ class Client:
|
|
|
164
164
|
server_url: str,
|
|
165
165
|
client_type: int,
|
|
166
166
|
credentials: typing.Optional[tuple[str, str]],
|
|
167
|
-
version: str = "1.2.2.
|
|
167
|
+
version: str = "1.2.2.dev32",
|
|
168
168
|
):
|
|
169
169
|
"""mdmd:hidden
|
|
170
170
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -408,7 +408,7 @@ class Function(
|
|
|
408
408
|
|
|
409
409
|
_call_generator: ___call_generator_spec[typing_extensions.Self]
|
|
410
410
|
|
|
411
|
-
class __remote_spec(typing_extensions.Protocol[
|
|
411
|
+
class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
|
412
412
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
|
|
413
413
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
414
414
|
...
|
|
@@ -417,7 +417,7 @@ class Function(
|
|
|
417
417
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
418
418
|
...
|
|
419
419
|
|
|
420
|
-
remote: __remote_spec[modal._functions.
|
|
420
|
+
remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
|
421
421
|
|
|
422
422
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
423
423
|
def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
|
@@ -444,7 +444,7 @@ class Function(
|
|
|
444
444
|
"""
|
|
445
445
|
...
|
|
446
446
|
|
|
447
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
|
447
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
|
448
448
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
449
449
|
"""[Experimental] Calls the function with the given arguments, without waiting for the results.
|
|
450
450
|
|
|
@@ -468,7 +468,7 @@ class Function(
|
|
|
468
468
|
...
|
|
469
469
|
|
|
470
470
|
_experimental_spawn: ___experimental_spawn_spec[
|
|
471
|
-
modal._functions.
|
|
471
|
+
modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
|
|
472
472
|
]
|
|
473
473
|
|
|
474
474
|
class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
|
|
@@ -477,7 +477,7 @@ class Function(
|
|
|
477
477
|
|
|
478
478
|
_spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
|
|
479
479
|
|
|
480
|
-
class __spawn_spec(typing_extensions.Protocol[
|
|
480
|
+
class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
|
481
481
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
482
482
|
"""Calls the function with the given arguments, without waiting for the results.
|
|
483
483
|
|
|
@@ -498,7 +498,7 @@ class Function(
|
|
|
498
498
|
"""
|
|
499
499
|
...
|
|
500
500
|
|
|
501
|
-
spawn: __spawn_spec[modal._functions.
|
|
501
|
+
spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
|
502
502
|
|
|
503
503
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
|
|
504
504
|
"""Return the inner Python object wrapped by this Modal Function."""
|
|
@@ -721,7 +721,6 @@ class FunctionCall(typing.Generic[modal._functions.ReturnType], modal.object.Obj
|
|
|
721
721
|
...
|
|
722
722
|
|
|
723
723
|
def _invocation(self): ...
|
|
724
|
-
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
725
724
|
|
|
726
725
|
class __num_inputs_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
727
726
|
def __call__(self, /) -> int:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|