modal 0.62.16__py3-none-any.whl → 0.72.11__py3-none-any.whl
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/__init__.py +17 -13
- modal/__main__.py +41 -3
- modal/_clustered_functions.py +80 -0
- modal/_clustered_functions.pyi +22 -0
- modal/_container_entrypoint.py +420 -937
- modal/_ipython.py +3 -13
- modal/_location.py +17 -10
- modal/_output.py +243 -99
- modal/_pty.py +2 -2
- modal/_resolver.py +55 -59
- modal/_resources.py +51 -0
- modal/_runtime/__init__.py +1 -0
- modal/_runtime/asgi.py +519 -0
- modal/_runtime/container_io_manager.py +1036 -0
- modal/_runtime/execution_context.py +89 -0
- modal/_runtime/telemetry.py +169 -0
- modal/_runtime/user_code_imports.py +356 -0
- modal/_serialization.py +134 -9
- modal/_traceback.py +47 -187
- modal/_tunnel.py +52 -16
- modal/_tunnel.pyi +19 -36
- modal/_utils/app_utils.py +3 -17
- modal/_utils/async_utils.py +479 -100
- modal/_utils/blob_utils.py +157 -186
- modal/_utils/bytes_io_segment_payload.py +97 -0
- modal/_utils/deprecation.py +89 -0
- modal/_utils/docker_utils.py +98 -0
- modal/_utils/function_utils.py +460 -171
- modal/_utils/grpc_testing.py +47 -31
- modal/_utils/grpc_utils.py +62 -109
- modal/_utils/hash_utils.py +61 -19
- modal/_utils/http_utils.py +39 -9
- modal/_utils/logger.py +2 -1
- modal/_utils/mount_utils.py +34 -16
- modal/_utils/name_utils.py +58 -0
- modal/_utils/package_utils.py +14 -1
- modal/_utils/pattern_utils.py +205 -0
- modal/_utils/rand_pb_testing.py +5 -7
- modal/_utils/shell_utils.py +15 -49
- modal/_vendor/a2wsgi_wsgi.py +62 -72
- modal/_vendor/cloudpickle.py +1 -1
- modal/_watcher.py +14 -12
- modal/app.py +1003 -314
- modal/app.pyi +540 -264
- modal/call_graph.py +7 -6
- modal/cli/_download.py +63 -53
- modal/cli/_traceback.py +200 -0
- modal/cli/app.py +205 -45
- modal/cli/config.py +12 -5
- modal/cli/container.py +62 -14
- modal/cli/dict.py +128 -0
- modal/cli/entry_point.py +26 -13
- modal/cli/environment.py +40 -9
- modal/cli/import_refs.py +64 -58
- modal/cli/launch.py +32 -18
- modal/cli/network_file_system.py +64 -83
- modal/cli/profile.py +1 -1
- modal/cli/programs/run_jupyter.py +35 -10
- modal/cli/programs/vscode.py +60 -10
- modal/cli/queues.py +131 -0
- modal/cli/run.py +234 -131
- modal/cli/secret.py +8 -7
- modal/cli/token.py +7 -2
- modal/cli/utils.py +79 -10
- modal/cli/volume.py +110 -109
- modal/client.py +250 -144
- modal/client.pyi +157 -118
- modal/cloud_bucket_mount.py +108 -34
- modal/cloud_bucket_mount.pyi +32 -38
- modal/cls.py +535 -148
- modal/cls.pyi +190 -146
- modal/config.py +41 -19
- modal/container_process.py +177 -0
- modal/container_process.pyi +82 -0
- modal/dict.py +111 -65
- modal/dict.pyi +136 -131
- modal/environments.py +106 -5
- modal/environments.pyi +77 -25
- modal/exception.py +34 -43
- modal/experimental.py +61 -2
- modal/extensions/ipython.py +5 -5
- modal/file_io.py +537 -0
- modal/file_io.pyi +235 -0
- modal/file_pattern_matcher.py +197 -0
- modal/functions.py +906 -911
- modal/functions.pyi +466 -430
- modal/gpu.py +57 -44
- modal/image.py +1089 -479
- modal/image.pyi +584 -228
- modal/io_streams.py +434 -0
- modal/io_streams.pyi +122 -0
- modal/mount.py +314 -101
- modal/mount.pyi +241 -235
- modal/network_file_system.py +92 -92
- modal/network_file_system.pyi +152 -110
- modal/object.py +67 -36
- modal/object.pyi +166 -143
- modal/output.py +63 -0
- modal/parallel_map.py +434 -0
- modal/parallel_map.pyi +75 -0
- modal/partial_function.py +282 -117
- modal/partial_function.pyi +222 -129
- modal/proxy.py +15 -12
- modal/proxy.pyi +3 -8
- modal/queue.py +182 -65
- modal/queue.pyi +218 -118
- modal/requirements/2024.04.txt +29 -0
- modal/requirements/2024.10.txt +16 -0
- modal/requirements/README.md +21 -0
- modal/requirements/base-images.json +22 -0
- modal/retries.py +48 -7
- modal/runner.py +459 -156
- modal/runner.pyi +135 -71
- modal/running_app.py +38 -0
- modal/sandbox.py +514 -236
- modal/sandbox.pyi +397 -169
- modal/schedule.py +4 -4
- modal/scheduler_placement.py +20 -3
- modal/secret.py +56 -31
- modal/secret.pyi +62 -42
- modal/serving.py +51 -56
- modal/serving.pyi +44 -36
- modal/stream_type.py +15 -0
- modal/token_flow.py +5 -3
- modal/token_flow.pyi +37 -32
- modal/volume.py +285 -157
- modal/volume.pyi +249 -184
- {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/METADATA +7 -7
- modal-0.72.11.dist-info/RECORD +174 -0
- {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/top_level.txt +0 -1
- modal_docs/gen_reference_docs.py +3 -1
- modal_docs/mdmd/mdmd.py +0 -1
- modal_docs/mdmd/signatures.py +5 -2
- modal_global_objects/images/base_images.py +28 -0
- modal_global_objects/mounts/python_standalone.py +2 -2
- modal_proto/__init__.py +1 -1
- modal_proto/api.proto +1288 -533
- modal_proto/api_grpc.py +856 -456
- modal_proto/api_pb2.py +2165 -1157
- modal_proto/api_pb2.pyi +8859 -0
- modal_proto/api_pb2_grpc.py +1674 -855
- modal_proto/api_pb2_grpc.pyi +1416 -0
- modal_proto/modal_api_grpc.py +149 -0
- modal_proto/modal_options_grpc.py +3 -0
- modal_proto/options_pb2.pyi +20 -0
- modal_proto/options_pb2_grpc.pyi +7 -0
- modal_proto/py.typed +0 -0
- modal_version/__init__.py +1 -1
- modal_version/_version_generated.py +2 -2
- modal/_asgi.py +0 -370
- modal/_container_entrypoint.pyi +0 -378
- modal/_container_exec.py +0 -128
- modal/_sandbox_shell.py +0 -49
- modal/shared_volume.py +0 -23
- modal/shared_volume.pyi +0 -24
- modal/stub.py +0 -783
- modal/stub.pyi +0 -332
- modal-0.62.16.dist-info/RECORD +0 -198
- modal_global_objects/images/conda.py +0 -15
- modal_global_objects/images/debian_slim.py +0 -15
- modal_global_objects/images/micromamba.py +0 -15
- test/__init__.py +0 -1
- test/aio_test.py +0 -12
- test/async_utils_test.py +0 -262
- test/blob_test.py +0 -67
- test/cli_imports_test.py +0 -149
- test/cli_test.py +0 -659
- test/client_test.py +0 -194
- test/cls_test.py +0 -630
- test/config_test.py +0 -137
- test/conftest.py +0 -1420
- test/container_app_test.py +0 -32
- test/container_test.py +0 -1389
- test/cpu_test.py +0 -23
- test/decorator_test.py +0 -85
- test/deprecation_test.py +0 -34
- test/dict_test.py +0 -33
- test/e2e_test.py +0 -68
- test/error_test.py +0 -7
- test/function_serialization_test.py +0 -32
- test/function_test.py +0 -653
- test/function_utils_test.py +0 -101
- test/gpu_test.py +0 -159
- test/grpc_utils_test.py +0 -141
- test/helpers.py +0 -42
- test/image_test.py +0 -669
- test/live_reload_test.py +0 -80
- test/lookup_test.py +0 -70
- test/mdmd_test.py +0 -329
- test/mount_test.py +0 -162
- test/mounted_files_test.py +0 -329
- test/network_file_system_test.py +0 -181
- test/notebook_test.py +0 -66
- test/object_test.py +0 -41
- test/package_utils_test.py +0 -25
- test/queue_test.py +0 -97
- test/resolver_test.py +0 -58
- test/retries_test.py +0 -67
- test/runner_test.py +0 -85
- test/sandbox_test.py +0 -191
- test/schedule_test.py +0 -15
- test/scheduler_placement_test.py +0 -29
- test/secret_test.py +0 -78
- test/serialization_test.py +0 -42
- test/stub_composition_test.py +0 -10
- test/stub_test.py +0 -360
- test/test_asgi_wrapper.py +0 -234
- test/token_flow_test.py +0 -18
- test/traceback_test.py +0 -135
- test/tunnel_test.py +0 -29
- test/utils_test.py +0 -88
- test/version_test.py +0 -14
- test/volume_test.py +0 -341
- test/watcher_test.py +0 -30
- test/webhook_test.py +0 -146
- /modal/{requirements.312.txt → requirements/2023.12.312.txt} +0 -0
- /modal/{requirements.txt → requirements/2023.12.txt} +0 -0
- {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/LICENSE +0 -0
- {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/WHEEL +0 -0
- {modal-0.62.16.dist-info → modal-0.72.11.dist-info}/entry_points.txt +0 -0
modal/functions.pyi
CHANGED
@@ -1,565 +1,601 @@
|
|
1
|
-
import
|
1
|
+
import collections.abc
|
2
2
|
import google.protobuf.message
|
3
|
-
import modal.
|
3
|
+
import modal._utils.async_utils
|
4
4
|
import modal._utils.function_utils
|
5
|
+
import modal.app
|
5
6
|
import modal.call_graph
|
6
7
|
import modal.client
|
7
8
|
import modal.cloud_bucket_mount
|
9
|
+
import modal.cls
|
8
10
|
import modal.gpu
|
9
11
|
import modal.image
|
10
12
|
import modal.mount
|
11
13
|
import modal.network_file_system
|
12
14
|
import modal.object
|
15
|
+
import modal.parallel_map
|
16
|
+
import modal.partial_function
|
13
17
|
import modal.proxy
|
14
18
|
import modal.retries
|
15
19
|
import modal.schedule
|
16
20
|
import modal.scheduler_placement
|
17
21
|
import modal.secret
|
18
|
-
import modal.stub
|
19
22
|
import modal.volume
|
20
|
-
import modal_proto.api_grpc
|
21
23
|
import modal_proto.api_pb2
|
24
|
+
import modal_proto.modal_api_grpc
|
22
25
|
import pathlib
|
23
26
|
import typing
|
24
27
|
import typing_extensions
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def __init__(self, value: typing.Any) -> None:
|
46
|
-
...
|
47
|
-
|
48
|
-
def __repr__(self):
|
49
|
-
...
|
50
|
-
|
51
|
-
def __eq__(self, other):
|
52
|
-
...
|
53
|
-
|
29
|
+
class _RetryContext:
|
30
|
+
function_call_invocation_type: int
|
31
|
+
retry_policy: modal_proto.api_pb2.FunctionRetryPolicy
|
32
|
+
function_call_jwt: str
|
33
|
+
input_jwt: str
|
34
|
+
input_id: str
|
35
|
+
item: modal_proto.api_pb2.FunctionPutInputsItem
|
36
|
+
|
37
|
+
def __init__(
|
38
|
+
self,
|
39
|
+
function_call_invocation_type: int,
|
40
|
+
retry_policy: modal_proto.api_pb2.FunctionRetryPolicy,
|
41
|
+
function_call_jwt: str,
|
42
|
+
input_jwt: str,
|
43
|
+
input_id: str,
|
44
|
+
item: modal_proto.api_pb2.FunctionPutInputsItem,
|
45
|
+
) -> None: ...
|
46
|
+
def __repr__(self): ...
|
47
|
+
def __eq__(self, other): ...
|
54
48
|
|
55
49
|
class _Invocation:
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
stub: modal_proto.modal_api_grpc.ModalClientModal
|
51
|
+
|
52
|
+
def __init__(
|
53
|
+
self,
|
54
|
+
stub: modal_proto.modal_api_grpc.ModalClientModal,
|
55
|
+
function_call_id: str,
|
56
|
+
client: modal.client._Client,
|
57
|
+
retry_context: typing.Optional[_RetryContext] = None,
|
58
|
+
): ...
|
59
59
|
@staticmethod
|
60
|
-
async def create(
|
61
|
-
|
62
|
-
|
63
|
-
def pop_function_call_outputs(
|
64
|
-
|
65
|
-
|
66
|
-
async def
|
67
|
-
|
68
|
-
|
69
|
-
async def poll_function(self, timeout: typing.
|
70
|
-
|
71
|
-
|
72
|
-
def run_generator(self):
|
73
|
-
...
|
74
|
-
|
75
|
-
|
76
|
-
def _map_invocation(function_id: str, input_stream: typing.AsyncIterable[typing.Any], kwargs: typing.Dict[str, typing.Any], client: modal.client._Client, order_outputs: bool, return_exceptions: bool, count_update_callback: typing.Union[typing.Callable[[int, int], None], None]):
|
77
|
-
...
|
78
|
-
|
60
|
+
async def create(
|
61
|
+
function: _Function, args, kwargs, *, client: modal.client._Client, function_call_invocation_type: int
|
62
|
+
) -> _Invocation: ...
|
63
|
+
async def pop_function_call_outputs(
|
64
|
+
self, timeout: typing.Optional[float], clear_on_success: bool, input_jwts: typing.Optional[list[str]] = None
|
65
|
+
) -> modal_proto.api_pb2.FunctionGetOutputsResponse: ...
|
66
|
+
async def _retry_input(self) -> None: ...
|
67
|
+
async def _get_single_output(self, expected_jwt: typing.Optional[str] = None) -> typing.Any: ...
|
68
|
+
async def run_function(self) -> typing.Any: ...
|
69
|
+
async def poll_function(self, timeout: typing.Optional[float] = None): ...
|
70
|
+
def run_generator(self): ...
|
79
71
|
|
80
72
|
class FunctionStats:
|
81
73
|
backlog: int
|
82
|
-
num_active_runners: int
|
83
74
|
num_total_runners: int
|
84
75
|
|
85
|
-
def
|
86
|
-
|
87
|
-
|
88
|
-
def
|
89
|
-
|
90
|
-
|
91
|
-
def
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
76
|
+
def __getattr__(self, name): ...
|
77
|
+
def __init__(self, backlog: int, num_total_runners: int) -> None: ...
|
78
|
+
def __repr__(self): ...
|
79
|
+
def __eq__(self, other): ...
|
80
|
+
def __setattr__(self, name, value): ...
|
81
|
+
def __delattr__(self, name): ...
|
82
|
+
def __hash__(self): ...
|
83
|
+
|
84
|
+
def _parse_retries(
|
85
|
+
retries: typing.Union[int, modal.retries.Retries, None], source: str = ""
|
86
|
+
) -> typing.Optional[modal_proto.api_pb2.FunctionRetryPolicy]: ...
|
87
|
+
|
88
|
+
class _FunctionSpec:
|
89
|
+
image: typing.Optional[modal.image._Image]
|
90
|
+
mounts: collections.abc.Sequence[modal.mount._Mount]
|
91
|
+
secrets: collections.abc.Sequence[modal.secret._Secret]
|
92
|
+
network_file_systems: dict[typing.Union[str, pathlib.PurePosixPath], modal.network_file_system._NetworkFileSystem]
|
93
|
+
volumes: dict[
|
94
|
+
typing.Union[str, pathlib.PurePosixPath],
|
95
|
+
typing.Union[modal.volume._Volume, modal.cloud_bucket_mount._CloudBucketMount],
|
96
|
+
]
|
97
|
+
gpus: typing.Union[None, bool, str, modal.gpu._GPUConfig, list[typing.Union[None, bool, str, modal.gpu._GPUConfig]]]
|
98
|
+
cloud: typing.Optional[str]
|
99
|
+
cpu: typing.Union[float, tuple[float, float], None]
|
100
|
+
memory: typing.Union[int, tuple[int, int], None]
|
101
|
+
ephemeral_disk: typing.Optional[int]
|
102
|
+
scheduler_placement: typing.Optional[modal.scheduler_placement.SchedulerPlacement]
|
103
|
+
proxy: typing.Optional[modal.proxy._Proxy]
|
104
|
+
|
105
|
+
def __init__(
|
106
|
+
self,
|
107
|
+
image: typing.Optional[modal.image._Image],
|
108
|
+
mounts: collections.abc.Sequence[modal.mount._Mount],
|
109
|
+
secrets: collections.abc.Sequence[modal.secret._Secret],
|
110
|
+
network_file_systems: dict[
|
111
|
+
typing.Union[str, pathlib.PurePosixPath], modal.network_file_system._NetworkFileSystem
|
112
|
+
],
|
113
|
+
volumes: dict[
|
114
|
+
typing.Union[str, pathlib.PurePosixPath],
|
115
|
+
typing.Union[modal.volume._Volume, modal.cloud_bucket_mount._CloudBucketMount],
|
116
|
+
],
|
117
|
+
gpus: typing.Union[
|
118
|
+
None, bool, str, modal.gpu._GPUConfig, list[typing.Union[None, bool, str, modal.gpu._GPUConfig]]
|
119
|
+
],
|
120
|
+
cloud: typing.Optional[str],
|
121
|
+
cpu: typing.Union[float, tuple[float, float], None],
|
122
|
+
memory: typing.Union[int, tuple[int, int], None],
|
123
|
+
ephemeral_disk: typing.Optional[int],
|
124
|
+
scheduler_placement: typing.Optional[modal.scheduler_placement.SchedulerPlacement],
|
125
|
+
proxy: typing.Optional[modal.proxy._Proxy],
|
126
|
+
) -> None: ...
|
127
|
+
def __repr__(self): ...
|
128
|
+
def __eq__(self, other): ...
|
129
|
+
|
130
|
+
P = typing_extensions.ParamSpec("P")
|
131
|
+
|
132
|
+
ReturnType = typing.TypeVar("ReturnType", covariant=True)
|
133
|
+
|
134
|
+
OriginalReturnType = typing.TypeVar("OriginalReturnType", covariant=True)
|
135
|
+
|
136
|
+
class _Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object._Object):
|
137
|
+
_info: typing.Optional[modal._utils.function_utils.FunctionInfo]
|
138
|
+
_serve_mounts: frozenset[modal.mount._Mount]
|
139
|
+
_app: typing.Optional[modal.app._App]
|
140
|
+
_obj: typing.Optional[modal.cls._Obj]
|
141
|
+
_web_url: typing.Optional[str]
|
142
|
+
_function_name: typing.Optional[str]
|
137
143
|
_is_method: bool
|
138
|
-
|
144
|
+
_spec: typing.Optional[_FunctionSpec]
|
139
145
|
_tag: str
|
140
146
|
_raw_f: typing.Callable[..., typing.Any]
|
141
147
|
_build_args: dict
|
142
|
-
|
148
|
+
_is_generator: typing.Optional[bool]
|
149
|
+
_cluster_size: typing.Optional[int]
|
150
|
+
_use_method_name: str
|
151
|
+
_class_parameter_info: typing.Optional[modal_proto.api_pb2.ClassParameterInfo]
|
152
|
+
_method_handle_metadata: typing.Optional[dict[str, modal_proto.api_pb2.FunctionHandleMetadata]]
|
143
153
|
|
154
|
+
def _bind_method(self, user_cls, method_name: str, partial_function: modal.partial_function._PartialFunction): ...
|
144
155
|
@staticmethod
|
145
|
-
def from_args(
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
156
|
+
def from_args(
|
157
|
+
info: modal._utils.function_utils.FunctionInfo,
|
158
|
+
app,
|
159
|
+
image: modal.image._Image,
|
160
|
+
secrets: collections.abc.Sequence[modal.secret._Secret] = (),
|
161
|
+
schedule: typing.Optional[modal.schedule.Schedule] = None,
|
162
|
+
is_generator: bool = False,
|
163
|
+
gpu: typing.Union[
|
164
|
+
None, bool, str, modal.gpu._GPUConfig, list[typing.Union[None, bool, str, modal.gpu._GPUConfig]]
|
165
|
+
] = None,
|
166
|
+
mounts: collections.abc.Collection[modal.mount._Mount] = (),
|
167
|
+
network_file_systems: dict[
|
168
|
+
typing.Union[str, pathlib.PurePosixPath], modal.network_file_system._NetworkFileSystem
|
169
|
+
] = {},
|
170
|
+
allow_cross_region_volumes: bool = False,
|
171
|
+
volumes: dict[
|
172
|
+
typing.Union[str, pathlib.PurePosixPath],
|
173
|
+
typing.Union[modal.volume._Volume, modal.cloud_bucket_mount._CloudBucketMount],
|
174
|
+
] = {},
|
175
|
+
webhook_config: typing.Optional[modal_proto.api_pb2.WebhookConfig] = None,
|
176
|
+
memory: typing.Union[int, tuple[int, int], None] = None,
|
177
|
+
proxy: typing.Optional[modal.proxy._Proxy] = None,
|
178
|
+
retries: typing.Union[int, modal.retries.Retries, None] = None,
|
179
|
+
timeout: typing.Optional[int] = None,
|
180
|
+
concurrency_limit: typing.Optional[int] = None,
|
181
|
+
allow_concurrent_inputs: typing.Optional[int] = None,
|
182
|
+
batch_max_size: typing.Optional[int] = None,
|
183
|
+
batch_wait_ms: typing.Optional[int] = None,
|
184
|
+
container_idle_timeout: typing.Optional[int] = None,
|
185
|
+
cpu: typing.Union[float, tuple[float, float], None] = None,
|
186
|
+
keep_warm: typing.Optional[int] = None,
|
187
|
+
cloud: typing.Optional[str] = None,
|
188
|
+
scheduler_placement: typing.Optional[modal.scheduler_placement.SchedulerPlacement] = None,
|
189
|
+
is_builder_function: bool = False,
|
190
|
+
is_auto_snapshot: bool = False,
|
191
|
+
enable_memory_snapshot: bool = False,
|
192
|
+
block_network: bool = False,
|
193
|
+
i6pn_enabled: bool = False,
|
194
|
+
cluster_size: typing.Optional[int] = None,
|
195
|
+
max_inputs: typing.Optional[int] = None,
|
196
|
+
ephemeral_disk: typing.Optional[int] = None,
|
197
|
+
_experimental_buffer_containers: typing.Optional[int] = None,
|
198
|
+
_experimental_proxy_ip: typing.Optional[str] = None,
|
199
|
+
_experimental_custom_scaling_factor: typing.Optional[float] = None,
|
200
|
+
) -> None: ...
|
201
|
+
def _bind_parameters(
|
202
|
+
self,
|
203
|
+
obj: modal.cls._Obj,
|
204
|
+
options: typing.Optional[modal_proto.api_pb2.FunctionOptions],
|
205
|
+
args: collections.abc.Sized,
|
206
|
+
kwargs: dict[str, typing.Any],
|
207
|
+
) -> _Function: ...
|
208
|
+
async def keep_warm(self, warm_pool_size: int) -> None: ...
|
154
209
|
@classmethod
|
155
|
-
def from_name(
|
156
|
-
|
157
|
-
|
210
|
+
def from_name(
|
211
|
+
cls: type[_Function], app_name: str, name: str, namespace=1, environment_name: typing.Optional[str] = None
|
212
|
+
) -> _Function: ...
|
158
213
|
@staticmethod
|
159
|
-
async def lookup(
|
160
|
-
|
161
|
-
|
214
|
+
async def lookup(
|
215
|
+
app_name: str,
|
216
|
+
name: str,
|
217
|
+
namespace=1,
|
218
|
+
client: typing.Optional[modal.client._Client] = None,
|
219
|
+
environment_name: typing.Optional[str] = None,
|
220
|
+
) -> _Function: ...
|
162
221
|
@property
|
163
|
-
def tag(self) -> str:
|
164
|
-
...
|
165
|
-
|
222
|
+
def tag(self) -> str: ...
|
166
223
|
@property
|
167
|
-
def
|
168
|
-
...
|
169
|
-
|
224
|
+
def app(self) -> modal.app._App: ...
|
170
225
|
@property
|
171
|
-
def
|
172
|
-
...
|
173
|
-
|
226
|
+
def stub(self) -> modal.app._App: ...
|
174
227
|
@property
|
175
|
-
def
|
176
|
-
...
|
177
|
-
|
178
|
-
def get_build_def(self) -> str:
|
179
|
-
...
|
180
|
-
|
181
|
-
def _initialize_from_empty(self):
|
182
|
-
...
|
183
|
-
|
184
|
-
def _hydrate_metadata(self, metadata: typing.Union[google.protobuf.message.Message, None]):
|
185
|
-
...
|
186
|
-
|
187
|
-
def _get_metadata(self):
|
188
|
-
...
|
189
|
-
|
190
|
-
def _set_mute_cancellation(self, value: bool = True):
|
191
|
-
...
|
192
|
-
|
193
|
-
def _set_output_mgr(self, output_mgr: modal._output.OutputManager):
|
194
|
-
...
|
195
|
-
|
228
|
+
def info(self) -> modal._utils.function_utils.FunctionInfo: ...
|
196
229
|
@property
|
197
|
-
def
|
198
|
-
|
199
|
-
|
230
|
+
def spec(self) -> _FunctionSpec: ...
|
231
|
+
def get_build_def(self) -> str: ...
|
232
|
+
def _initialize_from_empty(self): ...
|
233
|
+
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
234
|
+
def _get_metadata(self): ...
|
235
|
+
def _check_no_web_url(self, fn_name: str): ...
|
200
236
|
@property
|
201
|
-
def
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
async def _call_function_nowait(self, args, kwargs) -> _Invocation:
|
211
|
-
|
212
|
-
|
213
|
-
def
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
def
|
220
|
-
|
221
|
-
|
222
|
-
async def
|
223
|
-
...
|
224
|
-
|
225
|
-
def starmap(self, input_iterator, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False) -> typing.AsyncGenerator[typing.Any, None]:
|
226
|
-
...
|
227
|
-
|
228
|
-
async def remote(self, *args, **kwargs) -> typing.Any:
|
229
|
-
...
|
230
|
-
|
231
|
-
def remote_gen(self, *args, **kwargs) -> typing.AsyncGenerator[typing.Any, None]:
|
232
|
-
...
|
233
|
-
|
234
|
-
async def shell(self, *args, **kwargs) -> None:
|
235
|
-
...
|
237
|
+
async def web_url(self) -> str: ...
|
238
|
+
@property
|
239
|
+
async def is_generator(self) -> bool: ...
|
240
|
+
@property
|
241
|
+
def cluster_size(self) -> int: ...
|
242
|
+
def _map(
|
243
|
+
self, input_queue: modal.parallel_map._SynchronizedQueue, order_outputs: bool, return_exceptions: bool
|
244
|
+
) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
245
|
+
async def _call_function(self, args, kwargs) -> ReturnType: ...
|
246
|
+
async def _call_function_nowait(self, args, kwargs, function_call_invocation_type: int) -> _Invocation: ...
|
247
|
+
def _call_generator(self, args, kwargs): ...
|
248
|
+
async def _call_generator_nowait(self, args, kwargs): ...
|
249
|
+
async def remote(self, *args: P.args, **kwargs: P.kwargs) -> ReturnType: ...
|
250
|
+
def remote_gen(self, *args, **kwargs) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
251
|
+
def _is_local(self): ...
|
252
|
+
def _get_info(self) -> modal._utils.function_utils.FunctionInfo: ...
|
253
|
+
def _get_obj(self) -> typing.Optional[modal.cls._Obj]: ...
|
254
|
+
def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
|
255
|
+
async def _experimental_spawn(self, *args: P.args, **kwargs: P.kwargs) -> _FunctionCall[ReturnType]: ...
|
256
|
+
async def spawn(self, *args: P.args, **kwargs: P.kwargs) -> _FunctionCall[ReturnType]: ...
|
257
|
+
def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
|
258
|
+
async def get_current_stats(self) -> FunctionStats: ...
|
236
259
|
|
237
|
-
|
238
|
-
|
260
|
+
class __map_spec(typing_extensions.Protocol):
|
261
|
+
def __call__(
|
262
|
+
self, *input_iterators, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False
|
263
|
+
) -> modal._utils.async_utils.AsyncOrSyncIterable: ...
|
264
|
+
def aio(
|
265
|
+
self,
|
266
|
+
*input_iterators: typing.Union[typing.Iterable[typing.Any], typing.AsyncIterable[typing.Any]],
|
267
|
+
kwargs={},
|
268
|
+
order_outputs: bool = True,
|
269
|
+
return_exceptions: bool = False,
|
270
|
+
) -> typing.AsyncGenerator[typing.Any, None]: ...
|
239
271
|
|
240
|
-
|
241
|
-
...
|
272
|
+
map: __map_spec
|
242
273
|
|
243
|
-
|
244
|
-
|
274
|
+
class __starmap_spec(typing_extensions.Protocol):
|
275
|
+
def __call__(
|
276
|
+
self,
|
277
|
+
input_iterator: typing.Iterable[typing.Sequence[typing.Any]],
|
278
|
+
kwargs={},
|
279
|
+
order_outputs: bool = True,
|
280
|
+
return_exceptions: bool = False,
|
281
|
+
) -> modal._utils.async_utils.AsyncOrSyncIterable: ...
|
282
|
+
def aio(
|
283
|
+
self,
|
284
|
+
input_iterator: typing.Union[
|
285
|
+
typing.Iterable[typing.Sequence[typing.Any]], typing.AsyncIterable[typing.Sequence[typing.Any]]
|
286
|
+
],
|
287
|
+
kwargs={},
|
288
|
+
order_outputs: bool = True,
|
289
|
+
return_exceptions: bool = False,
|
290
|
+
) -> typing.AsyncIterable[typing.Any]: ...
|
245
291
|
|
246
|
-
|
247
|
-
...
|
292
|
+
starmap: __starmap_spec
|
248
293
|
|
249
|
-
|
250
|
-
...
|
294
|
+
class __for_each_spec(typing_extensions.Protocol):
|
295
|
+
def __call__(self, *input_iterators, kwargs={}, ignore_exceptions: bool = False): ...
|
296
|
+
async def aio(self, *input_iterators, kwargs={}, ignore_exceptions: bool = False): ...
|
251
297
|
|
252
|
-
|
253
|
-
...
|
298
|
+
for_each: __for_each_spec
|
254
299
|
|
255
|
-
|
256
|
-
...
|
300
|
+
ReturnType_INNER = typing.TypeVar("ReturnType_INNER", covariant=True)
|
257
301
|
|
302
|
+
P_INNER = typing_extensions.ParamSpec("P_INNER")
|
258
303
|
|
259
|
-
class Function(modal.object.Object):
|
260
|
-
_info: typing.
|
261
|
-
|
262
|
-
|
263
|
-
_obj: typing.
|
264
|
-
_web_url: typing.
|
265
|
-
|
266
|
-
_function_name: typing.Union[str, None]
|
304
|
+
class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.Object):
|
305
|
+
_info: typing.Optional[modal._utils.function_utils.FunctionInfo]
|
306
|
+
_serve_mounts: frozenset[modal.mount.Mount]
|
307
|
+
_app: typing.Optional[modal.app.App]
|
308
|
+
_obj: typing.Optional[modal.cls.Obj]
|
309
|
+
_web_url: typing.Optional[str]
|
310
|
+
_function_name: typing.Optional[str]
|
267
311
|
_is_method: bool
|
268
|
-
|
312
|
+
_spec: typing.Optional[_FunctionSpec]
|
269
313
|
_tag: str
|
270
314
|
_raw_f: typing.Callable[..., typing.Any]
|
271
315
|
_build_args: dict
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
316
|
+
_is_generator: typing.Optional[bool]
|
317
|
+
_cluster_size: typing.Optional[int]
|
318
|
+
_use_method_name: str
|
319
|
+
_class_parameter_info: typing.Optional[modal_proto.api_pb2.ClassParameterInfo]
|
320
|
+
_method_handle_metadata: typing.Optional[dict[str, modal_proto.api_pb2.FunctionHandleMetadata]]
|
321
|
+
|
322
|
+
def __init__(self, *args, **kwargs): ...
|
323
|
+
def _bind_method(self, user_cls, method_name: str, partial_function: modal.partial_function.PartialFunction): ...
|
277
324
|
@staticmethod
|
278
|
-
def from_args(
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
325
|
+
def from_args(
|
326
|
+
info: modal._utils.function_utils.FunctionInfo,
|
327
|
+
app,
|
328
|
+
image: modal.image.Image,
|
329
|
+
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
330
|
+
schedule: typing.Optional[modal.schedule.Schedule] = None,
|
331
|
+
is_generator: bool = False,
|
332
|
+
gpu: typing.Union[
|
333
|
+
None, bool, str, modal.gpu._GPUConfig, list[typing.Union[None, bool, str, modal.gpu._GPUConfig]]
|
334
|
+
] = None,
|
335
|
+
mounts: collections.abc.Collection[modal.mount.Mount] = (),
|
336
|
+
network_file_systems: dict[
|
337
|
+
typing.Union[str, pathlib.PurePosixPath], modal.network_file_system.NetworkFileSystem
|
338
|
+
] = {},
|
339
|
+
allow_cross_region_volumes: bool = False,
|
340
|
+
volumes: dict[
|
341
|
+
typing.Union[str, pathlib.PurePosixPath],
|
342
|
+
typing.Union[modal.volume.Volume, modal.cloud_bucket_mount.CloudBucketMount],
|
343
|
+
] = {},
|
344
|
+
webhook_config: typing.Optional[modal_proto.api_pb2.WebhookConfig] = None,
|
345
|
+
memory: typing.Union[int, tuple[int, int], None] = None,
|
346
|
+
proxy: typing.Optional[modal.proxy.Proxy] = None,
|
347
|
+
retries: typing.Union[int, modal.retries.Retries, None] = None,
|
348
|
+
timeout: typing.Optional[int] = None,
|
349
|
+
concurrency_limit: typing.Optional[int] = None,
|
350
|
+
allow_concurrent_inputs: typing.Optional[int] = None,
|
351
|
+
batch_max_size: typing.Optional[int] = None,
|
352
|
+
batch_wait_ms: typing.Optional[int] = None,
|
353
|
+
container_idle_timeout: typing.Optional[int] = None,
|
354
|
+
cpu: typing.Union[float, tuple[float, float], None] = None,
|
355
|
+
keep_warm: typing.Optional[int] = None,
|
356
|
+
cloud: typing.Optional[str] = None,
|
357
|
+
scheduler_placement: typing.Optional[modal.scheduler_placement.SchedulerPlacement] = None,
|
358
|
+
is_builder_function: bool = False,
|
359
|
+
is_auto_snapshot: bool = False,
|
360
|
+
enable_memory_snapshot: bool = False,
|
361
|
+
block_network: bool = False,
|
362
|
+
i6pn_enabled: bool = False,
|
363
|
+
cluster_size: typing.Optional[int] = None,
|
364
|
+
max_inputs: typing.Optional[int] = None,
|
365
|
+
ephemeral_disk: typing.Optional[int] = None,
|
366
|
+
_experimental_buffer_containers: typing.Optional[int] = None,
|
367
|
+
_experimental_proxy_ip: typing.Optional[str] = None,
|
368
|
+
_experimental_custom_scaling_factor: typing.Optional[float] = None,
|
369
|
+
) -> None: ...
|
370
|
+
def _bind_parameters(
|
371
|
+
self,
|
372
|
+
obj: modal.cls.Obj,
|
373
|
+
options: typing.Optional[modal_proto.api_pb2.FunctionOptions],
|
374
|
+
args: collections.abc.Sized,
|
375
|
+
kwargs: dict[str, typing.Any],
|
376
|
+
) -> Function: ...
|
283
377
|
|
284
378
|
class __keep_warm_spec(typing_extensions.Protocol):
|
285
|
-
def __call__(self, warm_pool_size: int) -> None:
|
286
|
-
|
287
|
-
|
288
|
-
async def aio(self, *args, **kwargs) -> None:
|
289
|
-
...
|
379
|
+
def __call__(self, warm_pool_size: int) -> None: ...
|
380
|
+
async def aio(self, warm_pool_size: int) -> None: ...
|
290
381
|
|
291
382
|
keep_warm: __keep_warm_spec
|
292
383
|
|
293
384
|
@classmethod
|
294
|
-
def from_name(
|
295
|
-
|
385
|
+
def from_name(
|
386
|
+
cls: type[Function], app_name: str, name: str, namespace=1, environment_name: typing.Optional[str] = None
|
387
|
+
) -> Function: ...
|
296
388
|
|
297
389
|
class __lookup_spec(typing_extensions.Protocol):
|
298
|
-
def __call__(
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
390
|
+
def __call__(
|
391
|
+
self,
|
392
|
+
app_name: str,
|
393
|
+
name: str,
|
394
|
+
namespace=1,
|
395
|
+
client: typing.Optional[modal.client.Client] = None,
|
396
|
+
environment_name: typing.Optional[str] = None,
|
397
|
+
) -> Function: ...
|
398
|
+
async def aio(
|
399
|
+
self,
|
400
|
+
app_name: str,
|
401
|
+
name: str,
|
402
|
+
namespace=1,
|
403
|
+
client: typing.Optional[modal.client.Client] = None,
|
404
|
+
environment_name: typing.Optional[str] = None,
|
405
|
+
) -> Function: ...
|
303
406
|
|
304
407
|
lookup: __lookup_spec
|
305
408
|
|
306
409
|
@property
|
307
|
-
def tag(self) -> str:
|
308
|
-
...
|
309
|
-
|
410
|
+
def tag(self) -> str: ...
|
310
411
|
@property
|
311
|
-
def
|
312
|
-
...
|
313
|
-
|
412
|
+
def app(self) -> modal.app.App: ...
|
314
413
|
@property
|
315
|
-
def
|
316
|
-
...
|
317
|
-
|
414
|
+
def stub(self) -> modal.app.App: ...
|
318
415
|
@property
|
319
|
-
def
|
320
|
-
...
|
321
|
-
|
322
|
-
def get_build_def(self) -> str:
|
323
|
-
...
|
324
|
-
|
325
|
-
def _initialize_from_empty(self):
|
326
|
-
...
|
327
|
-
|
328
|
-
def _hydrate_metadata(self, metadata: typing.Union[google.protobuf.message.Message, None]):
|
329
|
-
...
|
330
|
-
|
331
|
-
def _get_metadata(self):
|
332
|
-
...
|
333
|
-
|
334
|
-
def _set_mute_cancellation(self, value: bool = True):
|
335
|
-
...
|
336
|
-
|
337
|
-
def _set_output_mgr(self, output_mgr: modal._output.OutputManager):
|
338
|
-
...
|
339
|
-
|
416
|
+
def info(self) -> modal._utils.function_utils.FunctionInfo: ...
|
340
417
|
@property
|
341
|
-
def
|
342
|
-
|
343
|
-
|
418
|
+
def spec(self) -> _FunctionSpec: ...
|
419
|
+
def get_build_def(self) -> str: ...
|
420
|
+
def _initialize_from_empty(self): ...
|
421
|
+
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
422
|
+
def _get_metadata(self): ...
|
423
|
+
def _check_no_web_url(self, fn_name: str): ...
|
424
|
+
@property
|
425
|
+
def web_url(self) -> str: ...
|
426
|
+
@property
|
427
|
+
def is_generator(self) -> bool: ...
|
344
428
|
@property
|
345
|
-
def
|
346
|
-
...
|
429
|
+
def cluster_size(self) -> int: ...
|
347
430
|
|
348
431
|
class ___map_spec(typing_extensions.Protocol):
|
349
|
-
def __call__(
|
350
|
-
|
351
|
-
|
352
|
-
def aio(
|
353
|
-
|
432
|
+
def __call__(
|
433
|
+
self, input_queue: modal.parallel_map.SynchronizedQueue, order_outputs: bool, return_exceptions: bool
|
434
|
+
) -> typing.Generator[typing.Any, None, None]: ...
|
435
|
+
def aio(
|
436
|
+
self, input_queue: modal.parallel_map.SynchronizedQueue, order_outputs: bool, return_exceptions: bool
|
437
|
+
) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
354
438
|
|
355
439
|
_map: ___map_spec
|
356
440
|
|
357
|
-
class ___call_function_spec(typing_extensions.Protocol):
|
358
|
-
def __call__(self, args, kwargs):
|
359
|
-
|
360
|
-
|
361
|
-
async def aio(self, *args, **kwargs):
|
362
|
-
...
|
441
|
+
class ___call_function_spec(typing_extensions.Protocol[ReturnType_INNER]):
|
442
|
+
def __call__(self, args, kwargs) -> ReturnType_INNER: ...
|
443
|
+
async def aio(self, args, kwargs) -> ReturnType_INNER: ...
|
363
444
|
|
364
|
-
_call_function: ___call_function_spec
|
445
|
+
_call_function: ___call_function_spec[ReturnType]
|
365
446
|
|
366
447
|
class ___call_function_nowait_spec(typing_extensions.Protocol):
|
367
|
-
def __call__(self, args, kwargs) -> _Invocation:
|
368
|
-
|
369
|
-
|
370
|
-
async def aio(self, *args, **kwargs) -> _Invocation:
|
371
|
-
...
|
448
|
+
def __call__(self, args, kwargs, function_call_invocation_type: int) -> _Invocation: ...
|
449
|
+
async def aio(self, args, kwargs, function_call_invocation_type: int) -> _Invocation: ...
|
372
450
|
|
373
451
|
_call_function_nowait: ___call_function_nowait_spec
|
374
452
|
|
375
|
-
|
376
|
-
...
|
453
|
+
class ___call_generator_spec(typing_extensions.Protocol):
|
454
|
+
def __call__(self, args, kwargs): ...
|
455
|
+
def aio(self, args, kwargs): ...
|
377
456
|
|
378
|
-
|
379
|
-
def __call__(self, args, kwargs):
|
380
|
-
...
|
457
|
+
_call_generator: ___call_generator_spec
|
381
458
|
|
382
|
-
|
383
|
-
|
459
|
+
class ___call_generator_nowait_spec(typing_extensions.Protocol):
|
460
|
+
def __call__(self, args, kwargs): ...
|
461
|
+
async def aio(self, args, kwargs): ...
|
384
462
|
|
385
463
|
_call_generator_nowait: ___call_generator_nowait_spec
|
386
464
|
|
387
|
-
class
|
388
|
-
def __call__(self, *
|
389
|
-
|
390
|
-
|
391
|
-
def aio(self, *input_iterators, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False) -> typing.AsyncGenerator[typing.Any, None]:
|
392
|
-
...
|
465
|
+
class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
|
466
|
+
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
467
|
+
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
393
468
|
|
394
|
-
|
395
|
-
|
396
|
-
class __for_each_spec(typing_extensions.Protocol):
|
397
|
-
def __call__(self, *input_iterators, kwargs={}, ignore_exceptions: bool = False):
|
398
|
-
...
|
399
|
-
|
400
|
-
async def aio(self, *args, **kwargs):
|
401
|
-
...
|
402
|
-
|
403
|
-
for_each: __for_each_spec
|
404
|
-
|
405
|
-
class __starmap_spec(typing_extensions.Protocol):
|
406
|
-
def __call__(self, input_iterator, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False) -> typing.Generator[typing.Any, None, None]:
|
407
|
-
...
|
408
|
-
|
409
|
-
def aio(self, input_iterator, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False) -> typing.AsyncGenerator[typing.Any, None]:
|
410
|
-
...
|
411
|
-
|
412
|
-
starmap: __starmap_spec
|
413
|
-
|
414
|
-
class __remote_spec(typing_extensions.Protocol):
|
415
|
-
def __call__(self, *args, **kwargs) -> typing.Any:
|
416
|
-
...
|
417
|
-
|
418
|
-
async def aio(self, *args, **kwargs) -> typing.Any:
|
419
|
-
...
|
420
|
-
|
421
|
-
remote: __remote_spec
|
469
|
+
remote: __remote_spec[ReturnType, P]
|
422
470
|
|
423
471
|
class __remote_gen_spec(typing_extensions.Protocol):
|
424
|
-
def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
425
|
-
|
426
|
-
|
427
|
-
def aio(self, *args, **kwargs) -> typing.AsyncGenerator[typing.Any, None]:
|
428
|
-
...
|
472
|
+
def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
|
473
|
+
def aio(self, *args, **kwargs) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
429
474
|
|
430
475
|
remote_gen: __remote_gen_spec
|
431
476
|
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
async def aio(self, *args, **kwargs) -> None:
|
437
|
-
...
|
438
|
-
|
439
|
-
shell: __shell_spec
|
440
|
-
|
441
|
-
def _get_is_remote_cls_method(self):
|
442
|
-
...
|
443
|
-
|
444
|
-
def _get_info(self):
|
445
|
-
...
|
477
|
+
def _is_local(self): ...
|
478
|
+
def _get_info(self) -> modal._utils.function_utils.FunctionInfo: ...
|
479
|
+
def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
|
480
|
+
def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
|
446
481
|
|
447
|
-
|
448
|
-
...
|
482
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
|
483
|
+
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
484
|
+
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
449
485
|
|
450
|
-
|
451
|
-
...
|
486
|
+
_experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
|
452
487
|
|
453
|
-
class __spawn_spec(typing_extensions.Protocol):
|
454
|
-
def __call__(self, *args, **kwargs) ->
|
455
|
-
|
488
|
+
class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
|
489
|
+
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
490
|
+
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
456
491
|
|
457
|
-
|
458
|
-
...
|
492
|
+
spawn: __spawn_spec[ReturnType, P]
|
459
493
|
|
460
|
-
|
461
|
-
|
462
|
-
def get_raw_f(self) -> typing.Callable[..., typing.Any]:
|
463
|
-
...
|
494
|
+
def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
|
464
495
|
|
465
496
|
class __get_current_stats_spec(typing_extensions.Protocol):
|
466
|
-
def __call__(self) -> FunctionStats:
|
467
|
-
|
468
|
-
|
469
|
-
async def aio(self, *args, **kwargs) -> FunctionStats:
|
470
|
-
...
|
497
|
+
def __call__(self) -> FunctionStats: ...
|
498
|
+
async def aio(self) -> FunctionStats: ...
|
471
499
|
|
472
500
|
get_current_stats: __get_current_stats_spec
|
473
501
|
|
502
|
+
class __map_spec(typing_extensions.Protocol):
|
503
|
+
def __call__(
|
504
|
+
self, *input_iterators, kwargs={}, order_outputs: bool = True, return_exceptions: bool = False
|
505
|
+
) -> modal._utils.async_utils.AsyncOrSyncIterable: ...
|
506
|
+
def aio(
|
507
|
+
self,
|
508
|
+
*input_iterators: typing.Union[typing.Iterable[typing.Any], typing.AsyncIterable[typing.Any]],
|
509
|
+
kwargs={},
|
510
|
+
order_outputs: bool = True,
|
511
|
+
return_exceptions: bool = False,
|
512
|
+
) -> typing.AsyncGenerator[typing.Any, None]: ...
|
513
|
+
|
514
|
+
map: __map_spec
|
515
|
+
|
516
|
+
class __starmap_spec(typing_extensions.Protocol):
|
517
|
+
def __call__(
|
518
|
+
self,
|
519
|
+
input_iterator: typing.Iterable[typing.Sequence[typing.Any]],
|
520
|
+
kwargs={},
|
521
|
+
order_outputs: bool = True,
|
522
|
+
return_exceptions: bool = False,
|
523
|
+
) -> modal._utils.async_utils.AsyncOrSyncIterable: ...
|
524
|
+
def aio(
|
525
|
+
self,
|
526
|
+
input_iterator: typing.Union[
|
527
|
+
typing.Iterable[typing.Sequence[typing.Any]], typing.AsyncIterable[typing.Sequence[typing.Any]]
|
528
|
+
],
|
529
|
+
kwargs={},
|
530
|
+
order_outputs: bool = True,
|
531
|
+
return_exceptions: bool = False,
|
532
|
+
) -> typing.AsyncIterable[typing.Any]: ...
|
474
533
|
|
475
|
-
|
476
|
-
def _invocation(self):
|
477
|
-
...
|
534
|
+
starmap: __starmap_spec
|
478
535
|
|
479
|
-
|
480
|
-
...
|
536
|
+
class __for_each_spec(typing_extensions.Protocol):
|
537
|
+
def __call__(self, *input_iterators, kwargs={}, ignore_exceptions: bool = False): ...
|
538
|
+
async def aio(self, *input_iterators, kwargs={}, ignore_exceptions: bool = False): ...
|
481
539
|
|
482
|
-
|
483
|
-
...
|
540
|
+
for_each: __for_each_spec
|
484
541
|
|
485
|
-
|
486
|
-
|
542
|
+
class _FunctionCall(typing.Generic[ReturnType], modal.object._Object):
|
543
|
+
_is_generator: bool
|
487
544
|
|
545
|
+
def _invocation(self): ...
|
546
|
+
async def get(self, timeout: typing.Optional[float] = None) -> ReturnType: ...
|
547
|
+
def get_gen(self) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
548
|
+
async def get_call_graph(self) -> list[modal.call_graph.InputInfo]: ...
|
549
|
+
async def cancel(self, terminate_containers: bool = False): ...
|
488
550
|
@staticmethod
|
489
|
-
async def from_id(
|
490
|
-
|
551
|
+
async def from_id(
|
552
|
+
function_call_id: str, client: typing.Optional[modal.client._Client] = None, is_generator: bool = False
|
553
|
+
) -> _FunctionCall: ...
|
491
554
|
|
555
|
+
class FunctionCall(typing.Generic[ReturnType], modal.object.Object):
|
556
|
+
_is_generator: bool
|
492
557
|
|
493
|
-
|
494
|
-
def
|
495
|
-
...
|
558
|
+
def __init__(self, *args, **kwargs): ...
|
559
|
+
def _invocation(self): ...
|
496
560
|
|
497
|
-
|
498
|
-
...
|
561
|
+
class __get_spec(typing_extensions.Protocol[ReturnType_INNER]):
|
562
|
+
def __call__(self, timeout: typing.Optional[float] = None) -> ReturnType_INNER: ...
|
563
|
+
async def aio(self, timeout: typing.Optional[float] = None) -> ReturnType_INNER: ...
|
499
564
|
|
500
|
-
|
501
|
-
def __call__(self, timeout: typing.Union[float, None] = None):
|
502
|
-
...
|
565
|
+
get: __get_spec[ReturnType]
|
503
566
|
|
504
|
-
|
505
|
-
|
567
|
+
class __get_gen_spec(typing_extensions.Protocol):
|
568
|
+
def __call__(self) -> typing.Generator[typing.Any, None, None]: ...
|
569
|
+
def aio(self) -> collections.abc.AsyncGenerator[typing.Any, None]: ...
|
506
570
|
|
507
|
-
|
571
|
+
get_gen: __get_gen_spec
|
508
572
|
|
509
573
|
class __get_call_graph_spec(typing_extensions.Protocol):
|
510
|
-
def __call__(self) ->
|
511
|
-
|
512
|
-
|
513
|
-
async def aio(self, *args, **kwargs) -> typing.List[modal.call_graph.InputInfo]:
|
514
|
-
...
|
574
|
+
def __call__(self) -> list[modal.call_graph.InputInfo]: ...
|
575
|
+
async def aio(self) -> list[modal.call_graph.InputInfo]: ...
|
515
576
|
|
516
577
|
get_call_graph: __get_call_graph_spec
|
517
578
|
|
518
579
|
class __cancel_spec(typing_extensions.Protocol):
|
519
|
-
def __call__(self):
|
520
|
-
|
521
|
-
|
522
|
-
async def aio(self, *args, **kwargs):
|
523
|
-
...
|
580
|
+
def __call__(self, terminate_containers: bool = False): ...
|
581
|
+
async def aio(self, terminate_containers: bool = False): ...
|
524
582
|
|
525
583
|
cancel: __cancel_spec
|
526
584
|
|
527
585
|
class __from_id_spec(typing_extensions.Protocol):
|
528
|
-
def __call__(
|
529
|
-
|
530
|
-
|
531
|
-
async def aio(
|
532
|
-
|
586
|
+
def __call__(
|
587
|
+
self, function_call_id: str, client: typing.Optional[modal.client.Client] = None, is_generator: bool = False
|
588
|
+
) -> FunctionCall: ...
|
589
|
+
async def aio(
|
590
|
+
self, function_call_id: str, client: typing.Optional[modal.client.Client] = None, is_generator: bool = False
|
591
|
+
) -> FunctionCall: ...
|
533
592
|
|
534
593
|
from_id: __from_id_spec
|
535
594
|
|
536
|
-
|
537
|
-
async def _gather(*function_calls: _FunctionCall):
|
538
|
-
...
|
539
|
-
|
595
|
+
async def _gather(*function_calls: _FunctionCall[ReturnType]) -> typing.Sequence[ReturnType]: ...
|
540
596
|
|
541
597
|
class __gather_spec(typing_extensions.Protocol):
|
542
|
-
def __call__(self, *function_calls: FunctionCall):
|
543
|
-
|
544
|
-
|
545
|
-
async def aio(self, *args, **kwargs):
|
546
|
-
...
|
598
|
+
def __call__(self, *function_calls: FunctionCall[ReturnType]) -> typing.Sequence[ReturnType]: ...
|
599
|
+
async def aio(self, *function_calls: FunctionCall[ReturnType]) -> typing.Sequence[ReturnType]: ...
|
547
600
|
|
548
601
|
gather: __gather_spec
|
549
|
-
|
550
|
-
|
551
|
-
def current_input_id() -> typing.Union[str, None]:
|
552
|
-
...
|
553
|
-
|
554
|
-
|
555
|
-
def current_function_call_id() -> typing.Union[str, None]:
|
556
|
-
...
|
557
|
-
|
558
|
-
|
559
|
-
def _set_current_context_ids(input_id: str, function_call_id: str) -> typing.Callable[[], None]:
|
560
|
-
...
|
561
|
-
|
562
|
-
|
563
|
-
_current_input_id: _contextvars.ContextVar
|
564
|
-
|
565
|
-
_current_function_call_id: _contextvars.ContextVar
|