modal 1.1.5.dev70__py3-none-any.whl → 1.1.5.dev72__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.

Potentially problematic release.


This version of modal might be problematic. Click here for more details.

modal/_functions.py CHANGED
@@ -605,6 +605,21 @@ class _FunctionSpec:
605
605
  proxy: Optional[_Proxy]
606
606
 
607
607
 
608
+ def _get_supported_input_output_formats(is_web_endpoint: bool, is_generator: bool, restrict_output: bool):
609
+ if is_web_endpoint:
610
+ supported_input_formats = [api_pb2.DATA_FORMAT_ASGI]
611
+ supported_output_formats = [api_pb2.DATA_FORMAT_ASGI, api_pb2.DATA_FORMAT_GENERATOR_DONE]
612
+ else:
613
+ supported_input_formats = [api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR]
614
+ if restrict_output:
615
+ supported_output_formats = [api_pb2.DATA_FORMAT_CBOR]
616
+ else:
617
+ supported_output_formats = [api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR]
618
+ if is_generator:
619
+ supported_output_formats.append(api_pb2.DATA_FORMAT_GENERATOR_DONE)
620
+ return supported_input_formats, supported_output_formats
621
+
622
+
608
623
  P = typing_extensions.ParamSpec("P")
609
624
  ReturnType = typing.TypeVar("ReturnType", covariant=True)
610
625
  OriginalReturnType = typing.TypeVar(
@@ -836,15 +851,9 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
836
851
  is_web_endpoint=is_web_endpoint,
837
852
  ignore_first_argument=True,
838
853
  )
839
- if is_web_endpoint:
840
- method_input_formats = [api_pb2.DATA_FORMAT_ASGI]
841
- method_output_formats = [api_pb2.DATA_FORMAT_ASGI]
842
- else:
843
- method_input_formats = [api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR]
844
- if restrict_output:
845
- method_output_formats = [api_pb2.DATA_FORMAT_CBOR]
846
- else:
847
- method_output_formats = [api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR]
854
+ method_input_formats, method_output_formats = _get_supported_input_output_formats(
855
+ is_web_endpoint, partial_function.params.is_generator or False, restrict_output
856
+ )
848
857
 
849
858
  method_definition = api_pb2.MethodDefinition(
850
859
  webhook_config=partial_function.params.webhook_config,
@@ -880,15 +889,11 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
880
889
  # classes don't have data formats themselves - input/output formats are set per method above
881
890
  supported_input_formats = []
882
891
  supported_output_formats = []
883
- elif webhook_config is not None:
884
- supported_input_formats = [api_pb2.DATA_FORMAT_ASGI]
885
- supported_output_formats = [api_pb2.DATA_FORMAT_ASGI]
886
892
  else:
887
- supported_input_formats = [api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR]
888
- if restrict_output:
889
- supported_output_formats = [api_pb2.DATA_FORMAT_CBOR]
890
- else:
891
- supported_output_formats = [api_pb2.DATA_FORMAT_PICKLE, api_pb2.DATA_FORMAT_CBOR]
893
+ is_web_endpoint = webhook_config is not None and webhook_config.type != api_pb2.WEBHOOK_TYPE_UNSPECIFIED
894
+ supported_input_formats, supported_output_formats = _get_supported_input_output_formats(
895
+ is_web_endpoint, is_generator, restrict_output
896
+ )
892
897
 
893
898
  async def _preload(self: _Function, resolver: Resolver, existing_object_id: Optional[str]):
894
899
  assert resolver.client and resolver.client.stub
modal/client.pyi CHANGED
@@ -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.dev70",
36
+ version: str = "1.1.5.dev72",
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.dev70",
167
+ version: str = "1.1.5.dev72",
168
168
  ):
169
169
  """mdmd:hidden
170
170
  The Modal client object is not intended to be instantiated directly by users.
modal/functions.pyi CHANGED
@@ -401,7 +401,7 @@ class Function(
401
401
 
402
402
  _call_generator: ___call_generator_spec[typing_extensions.Self]
403
403
 
404
- class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
404
+ class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
405
405
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
406
406
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
407
407
  ...
@@ -410,7 +410,7 @@ class Function(
410
410
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
411
411
  ...
412
412
 
413
- remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
413
+ remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
414
414
 
415
415
  class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
416
416
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
@@ -437,7 +437,7 @@ class Function(
437
437
  """
438
438
  ...
439
439
 
440
- class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
440
+ class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
441
441
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
442
442
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
443
443
 
@@ -461,7 +461,7 @@ class Function(
461
461
  ...
462
462
 
463
463
  _experimental_spawn: ___experimental_spawn_spec[
464
- modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
464
+ modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
465
465
  ]
466
466
 
467
467
  class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
@@ -470,7 +470,7 @@ class Function(
470
470
 
471
471
  _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
472
472
 
473
- class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
473
+ class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
474
474
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
475
475
  """Calls the function with the given arguments, without waiting for the results.
476
476
 
@@ -491,7 +491,7 @@ class Function(
491
491
  """
492
492
  ...
493
493
 
494
- spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
494
+ spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
495
495
 
496
496
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
497
497
  """Return the inner Python object wrapped by this Modal Function."""
modal/sandbox.py CHANGED
@@ -669,7 +669,8 @@ class _Sandbox(_Object, type_prefix="sb"):
669
669
  async def create_connect_token(
670
670
  self, user_metadata: Optional[Union[str, dict[str, Any]]] = None
671
671
  ) -> SandboxConnectCredentials:
672
- """Create a token for making HTTP connections to the sandbox.
672
+ """mdmd:hidden
673
+ [Alpha] Create a token for making HTTP connections to the sandbox.
673
674
 
674
675
  Also accepts an optional user_metadata string or dict to associate with the token. This metadata
675
676
  will be added to the headers by the proxy when forwarding requests to the sandbox."""
modal/sandbox.pyi CHANGED
@@ -276,7 +276,8 @@ class _Sandbox(modal._object._Object):
276
276
  async def create_connect_token(
277
277
  self, user_metadata: typing.Union[str, dict[str, typing.Any], None] = None
278
278
  ) -> SandboxConnectCredentials:
279
- """Create a token for making HTTP connections to the sandbox.
279
+ """mdmd:hidden
280
+ [Alpha] Create a token for making HTTP connections to the sandbox.
280
281
 
281
282
  Also accepts an optional user_metadata string or dict to associate with the token. This metadata
282
283
  will be added to the headers by the proxy when forwarding requests to the sandbox.
@@ -831,7 +832,8 @@ class Sandbox(modal.object.Object):
831
832
  def __call__(
832
833
  self, /, user_metadata: typing.Union[str, dict[str, typing.Any], None] = None
833
834
  ) -> SandboxConnectCredentials:
834
- """Create a token for making HTTP connections to the sandbox.
835
+ """mdmd:hidden
836
+ [Alpha] Create a token for making HTTP connections to the sandbox.
835
837
 
836
838
  Also accepts an optional user_metadata string or dict to associate with the token. This metadata
837
839
  will be added to the headers by the proxy when forwarding requests to the sandbox.
@@ -841,7 +843,8 @@ class Sandbox(modal.object.Object):
841
843
  async def aio(
842
844
  self, /, user_metadata: typing.Union[str, dict[str, typing.Any], None] = None
843
845
  ) -> SandboxConnectCredentials:
844
- """Create a token for making HTTP connections to the sandbox.
846
+ """mdmd:hidden
847
+ [Alpha] Create a token for making HTTP connections to the sandbox.
845
848
 
846
849
  Also accepts an optional user_metadata string or dict to associate with the token. This metadata
847
850
  will be added to the headers by the proxy when forwarding requests to the sandbox.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.1.5.dev70
3
+ Version: 1.1.5.dev72
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -3,7 +3,7 @@ modal/__main__.py,sha256=45H-GtwzaDfN-1nP4_HYvzN3s7AG_HXR4-ynrsjO_OI,2803
3
3
  modal/_clustered_functions.py,sha256=Sy4Sf_17EO8OL-FUe8LYcm4hrqLyQFCssNhr3p0SroU,3013
4
4
  modal/_clustered_functions.pyi,sha256=JmYwAGOLEnD5AF-gYF9O5tu-SgGjeoJz-X1j48b1Ijg,1157
5
5
  modal/_container_entrypoint.py,sha256=B_fIKKjWposiNsYOePifX7S6cR9hf5LRPhDfVums5O8,27867
6
- modal/_functions.py,sha256=NdvXSJP3AFslVJuq0qp0Ian7bCUJo0ftCPHc5vwv_I0,90744
6
+ modal/_functions.py,sha256=7YbMBWtMMWLFxCaD3MSD-2iU1R7v5HRxfve-vGNzHnE,90991
7
7
  modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
8
8
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
9
9
  modal/_object.py,sha256=gwsLdXb-Ecd8nH8LVCo8oVZPzzdyo9BrN1DjgQmsSuM,11967
@@ -22,7 +22,7 @@ modal/app.py,sha256=RRUz2NjAWIQLHtU2IEslOlnIOCxPiWts3IP3rTFArkY,49635
22
22
  modal/app.pyi,sha256=CDp_rlX3hBuFdv9VRsKvNKCgu_hS2IO2uNU5qhzmXps,44719
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=kyAIVB3Ay-XKJizQ_1ufUFB__EagV0MLmHJpyYyJ7J0,18636
25
- modal/client.pyi,sha256=XV5p_UeIm3PE7yQD33KGOZV-aLnVRneUizDLjxcPLAE,15831
25
+ modal/client.pyi,sha256=je28d_ORs4YpeOPYl2J5f_mFlxHsqHi5WzxDz3MJfsk,15831
26
26
  modal/cloud_bucket_mount.py,sha256=I2GRXYhOWLIz2kJZjXu75jAm9EJkBNcutGc6jR2ReUw,5928
27
27
  modal/cloud_bucket_mount.pyi,sha256=VuUOipMIHqFXMkD-3g2bsoqpSxV5qswlFHDOqPQzYAo,7405
28
28
  modal/cls.py,sha256=IZG9gLlssbhTgIn6iSEmBSKkbbkst3skASMae-59FII,40239
@@ -39,7 +39,7 @@ modal/file_io.py,sha256=OSKr77TujcXGJW1iikzYiHckLSmv07QBgBHcxxYEkoI,21456
39
39
  modal/file_io.pyi,sha256=xtO6Glf_BFwDE7QiQQo24QqcMf_Vv-iz7WojcGVlLBU,15932
40
40
  modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE,8116
41
41
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
42
- modal/functions.pyi,sha256=Z6VuukLrjASAgf0kV9I6c09WvP_b2gCujX6f9j2bBaw,37988
42
+ modal/functions.pyi,sha256=CMwApS396tdElFrjnV6RuL2DTCz4C3jYzYoq1y_LPUQ,37988
43
43
  modal/gpu.py,sha256=Fe5ORvVPDIstSq1xjmM6OoNgLYFWvogP9r5BgmD3hYg,6769
44
44
  modal/image.py,sha256=MN5-pEmj-i66_XUxHo_z_VIu6KD186dF70417KKiRt0,106712
45
45
  modal/image.pyi,sha256=Ba7rdjbktmibwG9yLf3SMRWycw34V8SScG-Krakx1Yk,76506
@@ -65,8 +65,8 @@ modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
65
65
  modal/runner.py,sha256=A_zaRmJ4dNpQJWNlwUI_GJIy2GMuaQBRjMAabX0Fmvg,24599
66
66
  modal/runner.pyi,sha256=vUDRKqLz09QvZsaCH1gTG_iujewj-eGxxb6-VmN6eAw,8531
67
67
  modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
68
- modal/sandbox.py,sha256=qi_zWDOntB6RSAejCrAAKcW3vZZOkdrBnuic4dBo7NI,45953
69
- modal/sandbox.pyi,sha256=Jkmi83cU0YfZTmGbyCiChHPcjpTjsagw4Q50_cowfNQ,50689
68
+ modal/sandbox.py,sha256=oxFhpz3PuIgybsS4k36EuVmGcEvtYqjJBx0fAFMX7ak,45981
69
+ modal/sandbox.pyi,sha256=OXDrF4y6BZDbtjy6XDcIJ4sNy11IU1evjW2gR725a-s,50781
70
70
  modal/schedule.py,sha256=ng0g0AqNY5GQI9KhkXZQ5Wam5G42glbkqVQsNpBtbDE,3078
71
71
  modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
72
72
  modal/secret.py,sha256=ThwP-PkwUZwiYkygqumh15n8P_77-N5ZyRWLc6I3r28,18323
@@ -153,7 +153,7 @@ modal/experimental/__init__.py,sha256=9gkVuDmu3m4TlKoU3MzEtTOemUSs8EEOWba40s7Aa0
153
153
  modal/experimental/flash.py,sha256=C4sef08rARYFllsgtqukFmYL18SZW0_JpMS0BejDcUs,28552
154
154
  modal/experimental/flash.pyi,sha256=vV_OQhtdrPn8SW0XrBK-aLLHHIvxAzLzwFbWrke-m74,15463
155
155
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
156
- modal-1.1.5.dev70.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
156
+ modal-1.1.5.dev72.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
157
157
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
158
158
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
159
159
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -182,10 +182,10 @@ modal_proto/sandbox_router_pb2.py,sha256=INd9izYaIYqllESQt4MSv2Rj9Hf5bMjAvtCc9b4
182
182
  modal_proto/sandbox_router_pb2.pyi,sha256=YCK0WnCgRos3-p7t4USQQ7x6WAuM278yeQX2IeU5mLg,13295
183
183
  modal_proto/sandbox_router_pb2_grpc.py,sha256=zonC5flvCwxeZYJPENj1IJo2Mr0J58DpoC1_8IdPYik,8243
184
184
  modal_proto/sandbox_router_pb2_grpc.pyi,sha256=4QgCB9b7_ykvH8YD-hfnogVH9CLyHVDC5QNb03l4_X8,2735
185
- modal_version/__init__.py,sha256=TJbJLS8VxCtMvtNmRk8DgDSQk-lMoXQ9EufaftQvEqc,121
185
+ modal_version/__init__.py,sha256=lx0DT9YRjYMeTVnZAz4RkkChpenH8oqHAQaskhqF14w,121
186
186
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
187
- modal-1.1.5.dev70.dist-info/METADATA,sha256=BaDPaXh1iYzavimRkpbWXdMIPop98EOJ8Z1dXM0s6H8,2481
188
- modal-1.1.5.dev70.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
189
- modal-1.1.5.dev70.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
190
- modal-1.1.5.dev70.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
191
- modal-1.1.5.dev70.dist-info/RECORD,,
187
+ modal-1.1.5.dev72.dist-info/METADATA,sha256=veiNJ2V7v6QhycXsbTx_lIjGeOqV4ITKyYqaJevlR7M,2481
188
+ modal-1.1.5.dev72.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
189
+ modal-1.1.5.dev72.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
190
+ modal-1.1.5.dev72.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
191
+ modal-1.1.5.dev72.dist-info/RECORD,,
modal_version/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
  """Supplies the current version of the modal client library."""
3
3
 
4
- __version__ = "1.1.5.dev70"
4
+ __version__ = "1.1.5.dev72"