modal 1.1.5.dev14__tar.gz → 1.1.5.dev16__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.1.5.dev14 → modal-1.1.5.dev16}/PKG-INFO +1 -1
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/client.pyi +2 -2
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/functions.pyi +6 -6
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/sandbox.py +28 -1
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/sandbox.pyi +63 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/api.proto +12 -2
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/api_pb2.py +467 -467
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/api_pb2.pyi +20 -7
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_version/__init__.py +1 -1
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/LICENSE +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/README.md +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/__main__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_clustered_functions.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_clustered_functions.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_container_entrypoint.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_functions.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_ipython.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_location.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_object.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_output.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_partial_function.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_pty.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_resolver.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_resources.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/asgi.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/execution_context.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/telemetry.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_serialization.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_traceback.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_tunnel.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_tunnel.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_type_manager.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/app_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/async_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/blob_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/deprecation.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/docker_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/function_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/git_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/hash_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/http_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/logger.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/mount_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/name_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/package_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/shell_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_utils/time_utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_vendor/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_vendor/tblib.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/_watcher.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/app.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/app.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/2023.12.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/2024.04.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/2024.10.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/2025.06.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/README.md +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/builder/base-images.json +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/call_graph.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/_download.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/_traceback.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/app.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/cluster.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/config.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/container.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/dict.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/entry_point.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/environment.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/import_refs.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/launch.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/network_file_system.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/profile.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/programs/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/programs/launch_instance_ssh.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/programs/run_marimo.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/programs/vscode.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/queues.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/run.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/secret.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/token.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/utils.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cli/volume.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/client.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cls.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/cls.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/config.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/container_process.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/container_process.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/dict.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/dict.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/environments.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/environments.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/exception.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/experimental/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/experimental/flash.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/experimental/flash.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/experimental/ipython.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/file_io.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/file_io.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/file_pattern_matcher.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/functions.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/gpu.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/image.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/image.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/io_streams.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/io_streams.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/mount.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/mount.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/network_file_system.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/network_file_system.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/object.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/object.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/output.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/parallel_map.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/parallel_map.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/partial_function.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/partial_function.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/proxy.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/proxy.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/py.typed +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/queue.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/queue.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/retries.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/runner.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/runner.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/running_app.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/schedule.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/scheduler_placement.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/secret.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/secret.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/serving.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/serving.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/snapshot.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/snapshot.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/stream_type.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/token_flow.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/token_flow.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/volume.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal/volume.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal.egg-info/requires.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal.egg-info/top_level.txt +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_docs/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/__init__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/api_grpc.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/modal_options_grpc.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/options.proto +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/options_grpc.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/options_pb2.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/options_pb2.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/options_pb2_grpc.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/options_pb2_grpc.pyi +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_proto/py.typed +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/modal_version/__main__.py +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/pyproject.toml +0 -0
- {modal-1.1.5.dev14 → modal-1.1.5.dev16}/setup.cfg +0 -0
@@ -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.1.5.
|
36
|
+
version: str = "1.1.5.dev16",
|
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.1.5.
|
167
|
+
version: str = "1.1.5.dev16",
|
168
168
|
):
|
169
169
|
"""mdmd:hidden
|
170
170
|
The Modal client object is not intended to be instantiated directly by users.
|
@@ -445,7 +445,7 @@ class Function(
|
|
445
445
|
|
446
446
|
_call_generator: ___call_generator_spec[typing_extensions.Self]
|
447
447
|
|
448
|
-
class __remote_spec(typing_extensions.Protocol[
|
448
|
+
class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
449
449
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
|
450
450
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
451
451
|
...
|
@@ -454,7 +454,7 @@ class Function(
|
|
454
454
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
455
455
|
...
|
456
456
|
|
457
|
-
remote: __remote_spec[modal._functions.
|
457
|
+
remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
458
458
|
|
459
459
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
460
460
|
def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
@@ -481,7 +481,7 @@ class Function(
|
|
481
481
|
"""
|
482
482
|
...
|
483
483
|
|
484
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
484
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
485
485
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
486
486
|
"""[Experimental] Calls the function with the given arguments, without waiting for the results.
|
487
487
|
|
@@ -505,7 +505,7 @@ class Function(
|
|
505
505
|
...
|
506
506
|
|
507
507
|
_experimental_spawn: ___experimental_spawn_spec[
|
508
|
-
modal._functions.
|
508
|
+
modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
|
509
509
|
]
|
510
510
|
|
511
511
|
class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
|
@@ -514,7 +514,7 @@ class Function(
|
|
514
514
|
|
515
515
|
_spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
|
516
516
|
|
517
|
-
class __spawn_spec(typing_extensions.Protocol[
|
517
|
+
class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
518
518
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
519
519
|
"""Calls the function with the given arguments, without waiting for the results.
|
520
520
|
|
@@ -535,7 +535,7 @@ class Function(
|
|
535
535
|
"""
|
536
536
|
...
|
537
537
|
|
538
|
-
spawn: __spawn_spec[modal._functions.
|
538
|
+
spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
539
539
|
|
540
540
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
|
541
541
|
"""Return the inner Python object wrapped by this Modal Function."""
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# Copyright Modal Labs 2022
|
2
2
|
import asyncio
|
3
|
+
import json
|
3
4
|
import os
|
4
5
|
import time
|
5
6
|
from collections.abc import AsyncGenerator, Sequence
|
6
|
-
from
|
7
|
+
from dataclasses import dataclass
|
8
|
+
from typing import TYPE_CHECKING, Any, AsyncIterator, Literal, Optional, Union, overload
|
7
9
|
|
8
10
|
from .config import config, logger
|
9
11
|
|
@@ -99,6 +101,14 @@ class DefaultSandboxNameOverride(str):
|
|
99
101
|
_DEFAULT_SANDBOX_NAME_OVERRIDE = DefaultSandboxNameOverride()
|
100
102
|
|
101
103
|
|
104
|
+
@dataclass(frozen=True)
|
105
|
+
class SandboxConnectCredentials:
|
106
|
+
"""Simple data structure storing credentials for making HTTP connections to a sandbox."""
|
107
|
+
|
108
|
+
url: str
|
109
|
+
token: str
|
110
|
+
|
111
|
+
|
102
112
|
class _Sandbox(_Object, type_prefix="sb"):
|
103
113
|
"""A `Sandbox` object lets you interact with a running sandbox. This API is similar to Python's
|
104
114
|
[asyncio.subprocess.Process](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process).
|
@@ -626,6 +636,23 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
626
636
|
|
627
637
|
return self._tunnels
|
628
638
|
|
639
|
+
async def create_connect_token(
|
640
|
+
self, metadata: Optional[Union[str, dict[str, Any]]] = None
|
641
|
+
) -> SandboxConnectCredentials:
|
642
|
+
"""Create a token for making HTTP connections to the sandbox.
|
643
|
+
|
644
|
+
Also accepts an optional metadata string or dict to associate with the token. This metadata
|
645
|
+
will be added to the headers by the proxy when forwarding requests to the sandbox."""
|
646
|
+
if metadata is not None and isinstance(metadata, dict):
|
647
|
+
try:
|
648
|
+
metadata = json.dumps(metadata)
|
649
|
+
except Exception as e:
|
650
|
+
raise InvalidError(f"Failed to serialize metadata: {e}")
|
651
|
+
|
652
|
+
req = api_pb2.SandboxCreateConnectTokenRequest(sandbox_id=self.object_id, metadata=metadata)
|
653
|
+
resp = await retry_transient_errors(self._client.stub.SandboxCreateConnectToken, req)
|
654
|
+
return SandboxConnectCredentials(resp.url, resp.token)
|
655
|
+
|
629
656
|
async def reload_volumes(self) -> None:
|
630
657
|
"""Reload all Volumes mounted in the Sandbox.
|
631
658
|
|
@@ -39,6 +39,36 @@ class DefaultSandboxNameOverride(str):
|
|
39
39
|
|
40
40
|
_DEFAULT_SANDBOX_NAME_OVERRIDE: DefaultSandboxNameOverride
|
41
41
|
|
42
|
+
class SandboxConnectCredentials:
|
43
|
+
"""Simple data structure storing credentials for making HTTP connections to a sandbox."""
|
44
|
+
|
45
|
+
url: str
|
46
|
+
token: str
|
47
|
+
|
48
|
+
def __init__(self, url: str, token: str) -> None:
|
49
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
50
|
+
...
|
51
|
+
|
52
|
+
def __repr__(self):
|
53
|
+
"""Return repr(self)."""
|
54
|
+
...
|
55
|
+
|
56
|
+
def __eq__(self, other):
|
57
|
+
"""Return self==value."""
|
58
|
+
...
|
59
|
+
|
60
|
+
def __setattr__(self, name, value):
|
61
|
+
"""Implement setattr(self, name, value)."""
|
62
|
+
...
|
63
|
+
|
64
|
+
def __delattr__(self, name):
|
65
|
+
"""Implement delattr(self, name)."""
|
66
|
+
...
|
67
|
+
|
68
|
+
def __hash__(self):
|
69
|
+
"""Return hash(self)."""
|
70
|
+
...
|
71
|
+
|
42
72
|
class _Sandbox(modal._object._Object):
|
43
73
|
"""A `Sandbox` object lets you interact with a running sandbox. This API is similar to Python's
|
44
74
|
[asyncio.subprocess.Process](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process).
|
@@ -224,6 +254,16 @@ class _Sandbox(modal._object._Object):
|
|
224
254
|
"""
|
225
255
|
...
|
226
256
|
|
257
|
+
async def create_connect_token(
|
258
|
+
self, metadata: typing.Union[str, dict[str, typing.Any], None] = None
|
259
|
+
) -> SandboxConnectCredentials:
|
260
|
+
"""Create a token for making HTTP connections to the sandbox.
|
261
|
+
|
262
|
+
Also accepts an optional metadata string or dict to associate with the token. This metadata
|
263
|
+
will be added to the headers by the proxy when forwarding requests to the sandbox.
|
264
|
+
"""
|
265
|
+
...
|
266
|
+
|
227
267
|
async def reload_volumes(self) -> None:
|
228
268
|
"""Reload all Volumes mounted in the Sandbox.
|
229
269
|
|
@@ -708,6 +748,29 @@ class Sandbox(modal.object.Object):
|
|
708
748
|
|
709
749
|
tunnels: __tunnels_spec[typing_extensions.Self]
|
710
750
|
|
751
|
+
class __create_connect_token_spec(typing_extensions.Protocol[SUPERSELF]):
|
752
|
+
def __call__(
|
753
|
+
self, /, metadata: typing.Union[str, dict[str, typing.Any], None] = None
|
754
|
+
) -> SandboxConnectCredentials:
|
755
|
+
"""Create a token for making HTTP connections to the sandbox.
|
756
|
+
|
757
|
+
Also accepts an optional metadata string or dict to associate with the token. This metadata
|
758
|
+
will be added to the headers by the proxy when forwarding requests to the sandbox.
|
759
|
+
"""
|
760
|
+
...
|
761
|
+
|
762
|
+
async def aio(
|
763
|
+
self, /, metadata: typing.Union[str, dict[str, typing.Any], None] = None
|
764
|
+
) -> SandboxConnectCredentials:
|
765
|
+
"""Create a token for making HTTP connections to the sandbox.
|
766
|
+
|
767
|
+
Also accepts an optional metadata string or dict to associate with the token. This metadata
|
768
|
+
will be added to the headers by the proxy when forwarding requests to the sandbox.
|
769
|
+
"""
|
770
|
+
...
|
771
|
+
|
772
|
+
create_connect_token: __create_connect_token_spec[typing_extensions.Self]
|
773
|
+
|
711
774
|
class __reload_volumes_spec(typing_extensions.Protocol[SUPERSELF]):
|
712
775
|
def __call__(self, /) -> None:
|
713
776
|
"""Reload all Volumes mounted in the Sandbox.
|
@@ -2156,7 +2156,10 @@ message ListPagination {
|
|
2156
2156
|
}
|
2157
2157
|
|
2158
2158
|
message MapAwaitRequest {
|
2159
|
-
|
2159
|
+
oneof call_info {
|
2160
|
+
string function_call_id = 1;
|
2161
|
+
string map_token = 5;
|
2162
|
+
}
|
2160
2163
|
string last_entry_id = 2;
|
2161
2164
|
double requested_at = 3; // Used for waypoints.
|
2162
2165
|
float timeout = 4;
|
@@ -2185,11 +2188,18 @@ message MapStartOrContinueItem {
|
|
2185
2188
|
message MapStartOrContinueRequest {
|
2186
2189
|
string function_id = 1;
|
2187
2190
|
string parent_input_id = 2;
|
2188
|
-
|
2191
|
+
// Clients will send call_info on map continue requests.
|
2192
|
+
oneof call_info {
|
2193
|
+
string function_call_id = 3;
|
2194
|
+
string map_token = 5;
|
2195
|
+
}
|
2189
2196
|
repeated MapStartOrContinueItem items = 4;
|
2190
2197
|
}
|
2191
2198
|
|
2192
2199
|
message MapStartOrContinueResponse {
|
2200
|
+
// function_id and function_call_id are not necessary if map_token is provided.
|
2201
|
+
// All 3 will be sent until it is safe to only send map_token.
|
2202
|
+
string map_token = 6;
|
2193
2203
|
string function_id = 1;
|
2194
2204
|
string function_call_id = 2;
|
2195
2205
|
uint32 max_inputs_outstanding = 3;
|