modal 0.72.18__py3-none-any.whl → 0.72.19__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_proto/api_pb2.pyi CHANGED
@@ -8,6 +8,7 @@ import google.protobuf.descriptor
8
8
  import google.protobuf.internal.containers
9
9
  import google.protobuf.internal.enum_type_wrapper
10
10
  import google.protobuf.message
11
+ import google.protobuf.struct_pb2
11
12
  import google.protobuf.wrappers_pb2
12
13
  import sys
13
14
  import typing
@@ -6037,6 +6038,193 @@ class NetworkAccess(google.protobuf.message.Message):
6037
6038
 
6038
6039
  global___NetworkAccess = NetworkAccess
6039
6040
 
6041
+ class NotebookKernelPublishResultsRequest(google.protobuf.message.Message):
6042
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6043
+
6044
+ class ExecuteReply(google.protobuf.message.Message):
6045
+ """See kernelshim.py for the differences between this and `ExecuteResult`.
6046
+ https://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-results
6047
+ """
6048
+
6049
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6050
+
6051
+ STATUS_FIELD_NUMBER: builtins.int
6052
+ EXECUTION_COUNT_FIELD_NUMBER: builtins.int
6053
+ status: builtins.str
6054
+ execution_count: builtins.int
6055
+ def __init__(
6056
+ self,
6057
+ *,
6058
+ status: builtins.str = ...,
6059
+ execution_count: builtins.int = ...,
6060
+ ) -> None: ...
6061
+ def ClearField(self, field_name: typing_extensions.Literal["execution_count", b"execution_count", "status", b"status"]) -> None: ...
6062
+
6063
+ class CellResult(google.protobuf.message.Message):
6064
+ """IOPub message or reply received from the kernel for a cell."""
6065
+
6066
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6067
+
6068
+ CELL_ID_FIELD_NUMBER: builtins.int
6069
+ OUTPUT_FIELD_NUMBER: builtins.int
6070
+ CLEAR_OUTPUTS_FIELD_NUMBER: builtins.int
6071
+ EXECUTE_REPLY_FIELD_NUMBER: builtins.int
6072
+ cell_id: builtins.str
6073
+ @property
6074
+ def output(self) -> global___NotebookOutput:
6075
+ """Persistent output that is saved in the notebook."""
6076
+ clear_outputs: builtins.bool
6077
+ """Clear all previous outputs of the cell."""
6078
+ @property
6079
+ def execute_reply(self) -> global___NotebookKernelPublishResultsRequest.ExecuteReply:
6080
+ """Cell has finished executing, return the kernel's execute_reply."""
6081
+ def __init__(
6082
+ self,
6083
+ *,
6084
+ cell_id: builtins.str = ...,
6085
+ output: global___NotebookOutput | None = ...,
6086
+ clear_outputs: builtins.bool = ...,
6087
+ execute_reply: global___NotebookKernelPublishResultsRequest.ExecuteReply | None = ...,
6088
+ ) -> None: ...
6089
+ def HasField(self, field_name: typing_extensions.Literal["clear_outputs", b"clear_outputs", "execute_reply", b"execute_reply", "output", b"output", "result_type", b"result_type"]) -> builtins.bool: ...
6090
+ def ClearField(self, field_name: typing_extensions.Literal["cell_id", b"cell_id", "clear_outputs", b"clear_outputs", "execute_reply", b"execute_reply", "output", b"output", "result_type", b"result_type"]) -> None: ...
6091
+ def WhichOneof(self, oneof_group: typing_extensions.Literal["result_type", b"result_type"]) -> typing_extensions.Literal["output", "clear_outputs", "execute_reply"] | None: ...
6092
+
6093
+ NOTEBOOK_ID_FIELD_NUMBER: builtins.int
6094
+ RESULTS_FIELD_NUMBER: builtins.int
6095
+ notebook_id: builtins.str
6096
+ @property
6097
+ def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___NotebookKernelPublishResultsRequest.CellResult]: ...
6098
+ def __init__(
6099
+ self,
6100
+ *,
6101
+ notebook_id: builtins.str = ...,
6102
+ results: collections.abc.Iterable[global___NotebookKernelPublishResultsRequest.CellResult] | None = ...,
6103
+ ) -> None: ...
6104
+ def ClearField(self, field_name: typing_extensions.Literal["notebook_id", b"notebook_id", "results", b"results"]) -> None: ...
6105
+
6106
+ global___NotebookKernelPublishResultsRequest = NotebookKernelPublishResultsRequest
6107
+
6108
+ class NotebookOutput(google.protobuf.message.Message):
6109
+ """A single output from a notebook. When you execute a cell, it produces an
6110
+ array of these outputs as the code runs.
6111
+
6112
+ https://github.com/jupyter/nbformat/blob/v5.10.4/nbformat/v4/nbformat.v4.schema.json#L301-L309
6113
+ """
6114
+
6115
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6116
+
6117
+ class ExecuteResult(google.protobuf.message.Message):
6118
+ """Result of executing a code cell."""
6119
+
6120
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6121
+
6122
+ EXECUTION_COUNT_FIELD_NUMBER: builtins.int
6123
+ DATA_FIELD_NUMBER: builtins.int
6124
+ METADATA_FIELD_NUMBER: builtins.int
6125
+ execution_count: builtins.int
6126
+ @property
6127
+ def data(self) -> google.protobuf.struct_pb2.Struct:
6128
+ """mimebundle"""
6129
+ @property
6130
+ def metadata(self) -> google.protobuf.struct_pb2.Struct: ...
6131
+ def __init__(
6132
+ self,
6133
+ *,
6134
+ execution_count: builtins.int = ...,
6135
+ data: google.protobuf.struct_pb2.Struct | None = ...,
6136
+ metadata: google.protobuf.struct_pb2.Struct | None = ...,
6137
+ ) -> None: ...
6138
+ def HasField(self, field_name: typing_extensions.Literal["data", b"data", "metadata", b"metadata"]) -> builtins.bool: ...
6139
+ def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "execution_count", b"execution_count", "metadata", b"metadata"]) -> None: ...
6140
+
6141
+ class DisplayData(google.protobuf.message.Message):
6142
+ """Data displayed as a result of code cell execution."""
6143
+
6144
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6145
+
6146
+ DATA_FIELD_NUMBER: builtins.int
6147
+ METADATA_FIELD_NUMBER: builtins.int
6148
+ @property
6149
+ def data(self) -> google.protobuf.struct_pb2.Struct:
6150
+ """mimebundle"""
6151
+ @property
6152
+ def metadata(self) -> google.protobuf.struct_pb2.Struct: ...
6153
+ def __init__(
6154
+ self,
6155
+ *,
6156
+ data: google.protobuf.struct_pb2.Struct | None = ...,
6157
+ metadata: google.protobuf.struct_pb2.Struct | None = ...,
6158
+ ) -> None: ...
6159
+ def HasField(self, field_name: typing_extensions.Literal["data", b"data", "metadata", b"metadata"]) -> builtins.bool: ...
6160
+ def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "metadata", b"metadata"]) -> None: ...
6161
+
6162
+ class Stream(google.protobuf.message.Message):
6163
+ """Stream output from a code cell (stdout / stderr)."""
6164
+
6165
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6166
+
6167
+ NAME_FIELD_NUMBER: builtins.int
6168
+ TEXT_FIELD_NUMBER: builtins.int
6169
+ name: builtins.str
6170
+ """stdout | stderr"""
6171
+ text: builtins.str
6172
+ """multiline_string"""
6173
+ def __init__(
6174
+ self,
6175
+ *,
6176
+ name: builtins.str = ...,
6177
+ text: builtins.str = ...,
6178
+ ) -> None: ...
6179
+ def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "text", b"text"]) -> None: ...
6180
+
6181
+ class Error(google.protobuf.message.Message):
6182
+ """Output of an error that occurred during code cell execution."""
6183
+
6184
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
6185
+
6186
+ ENAME_FIELD_NUMBER: builtins.int
6187
+ EVALUE_FIELD_NUMBER: builtins.int
6188
+ TRACEBACK_FIELD_NUMBER: builtins.int
6189
+ ename: builtins.str
6190
+ evalue: builtins.str
6191
+ @property
6192
+ def traceback(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
6193
+ def __init__(
6194
+ self,
6195
+ *,
6196
+ ename: builtins.str = ...,
6197
+ evalue: builtins.str = ...,
6198
+ traceback: collections.abc.Iterable[builtins.str] | None = ...,
6199
+ ) -> None: ...
6200
+ def ClearField(self, field_name: typing_extensions.Literal["ename", b"ename", "evalue", b"evalue", "traceback", b"traceback"]) -> None: ...
6201
+
6202
+ EXECUTE_RESULT_FIELD_NUMBER: builtins.int
6203
+ DISPLAY_DATA_FIELD_NUMBER: builtins.int
6204
+ STREAM_FIELD_NUMBER: builtins.int
6205
+ ERROR_FIELD_NUMBER: builtins.int
6206
+ @property
6207
+ def execute_result(self) -> global___NotebookOutput.ExecuteResult: ...
6208
+ @property
6209
+ def display_data(self) -> global___NotebookOutput.DisplayData: ...
6210
+ @property
6211
+ def stream(self) -> global___NotebookOutput.Stream: ...
6212
+ @property
6213
+ def error(self) -> global___NotebookOutput.Error: ...
6214
+ def __init__(
6215
+ self,
6216
+ *,
6217
+ execute_result: global___NotebookOutput.ExecuteResult | None = ...,
6218
+ display_data: global___NotebookOutput.DisplayData | None = ...,
6219
+ stream: global___NotebookOutput.Stream | None = ...,
6220
+ error: global___NotebookOutput.Error | None = ...,
6221
+ ) -> None: ...
6222
+ def HasField(self, field_name: typing_extensions.Literal["display_data", b"display_data", "error", b"error", "execute_result", b"execute_result", "output_type", b"output_type", "stream", b"stream"]) -> builtins.bool: ...
6223
+ def ClearField(self, field_name: typing_extensions.Literal["display_data", b"display_data", "error", b"error", "execute_result", b"execute_result", "output_type", b"output_type", "stream", b"stream"]) -> None: ...
6224
+ def WhichOneof(self, oneof_group: typing_extensions.Literal["output_type", b"output_type"]) -> typing_extensions.Literal["execute_result", "display_data", "stream", "error"] | None: ...
6225
+
6226
+ global___NotebookOutput = NotebookOutput
6227
+
6040
6228
  class Object(google.protobuf.message.Message):
6041
6229
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
6042
6230
 
@@ -405,6 +405,11 @@ class ModalClientStub(object):
405
405
  request_serializer=modal__proto_dot_api__pb2.MountPutFileRequest.SerializeToString,
406
406
  response_deserializer=modal__proto_dot_api__pb2.MountPutFileResponse.FromString,
407
407
  )
408
+ self.NotebookKernelPublishResults = channel.unary_unary(
409
+ '/modal.client.ModalClient/NotebookKernelPublishResults',
410
+ request_serializer=modal__proto_dot_api__pb2.NotebookKernelPublishResultsRequest.SerializeToString,
411
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
412
+ )
408
413
  self.ProxyCreate = channel.unary_unary(
409
414
  '/modal.client.ModalClient/ProxyCreate',
410
415
  request_serializer=modal__proto_dot_api__pb2.ProxyCreateRequest.SerializeToString,
@@ -1177,6 +1182,13 @@ class ModalClientServicer(object):
1177
1182
  context.set_details('Method not implemented!')
1178
1183
  raise NotImplementedError('Method not implemented!')
1179
1184
 
1185
+ def NotebookKernelPublishResults(self, request, context):
1186
+ """Notebooks
1187
+ """
1188
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
1189
+ context.set_details('Method not implemented!')
1190
+ raise NotImplementedError('Method not implemented!')
1191
+
1180
1192
  def ProxyCreate(self, request, context):
1181
1193
  """Proxies
1182
1194
  """
@@ -1923,6 +1935,11 @@ def add_ModalClientServicer_to_server(servicer, server):
1923
1935
  request_deserializer=modal__proto_dot_api__pb2.MountPutFileRequest.FromString,
1924
1936
  response_serializer=modal__proto_dot_api__pb2.MountPutFileResponse.SerializeToString,
1925
1937
  ),
1938
+ 'NotebookKernelPublishResults': grpc.unary_unary_rpc_method_handler(
1939
+ servicer.NotebookKernelPublishResults,
1940
+ request_deserializer=modal__proto_dot_api__pb2.NotebookKernelPublishResultsRequest.FromString,
1941
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
1942
+ ),
1926
1943
  'ProxyCreate': grpc.unary_unary_rpc_method_handler(
1927
1944
  servicer.ProxyCreate,
1928
1945
  request_deserializer=modal__proto_dot_api__pb2.ProxyCreateRequest.FromString,
@@ -3544,6 +3561,23 @@ class ModalClient(object):
3544
3561
  options, channel_credentials,
3545
3562
  insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
3546
3563
 
3564
+ @staticmethod
3565
+ def NotebookKernelPublishResults(request,
3566
+ target,
3567
+ options=(),
3568
+ channel_credentials=None,
3569
+ call_credentials=None,
3570
+ insecure=False,
3571
+ compression=None,
3572
+ wait_for_ready=None,
3573
+ timeout=None,
3574
+ metadata=None):
3575
+ return grpc.experimental.unary_unary(request, target, '/modal.client.ModalClient/NotebookKernelPublishResults',
3576
+ modal__proto_dot_api__pb2.NotebookKernelPublishResultsRequest.SerializeToString,
3577
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
3578
+ options, channel_credentials,
3579
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
3580
+
3547
3581
  @staticmethod
3548
3582
  def ProxyCreate(request,
3549
3583
  target,
@@ -336,6 +336,11 @@ class ModalClientStub:
336
336
  modal_proto.api_pb2.MountPutFileRequest,
337
337
  modal_proto.api_pb2.MountPutFileResponse,
338
338
  ]
339
+ NotebookKernelPublishResults: grpc.UnaryUnaryMultiCallable[
340
+ modal_proto.api_pb2.NotebookKernelPublishResultsRequest,
341
+ google.protobuf.empty_pb2.Empty,
342
+ ]
343
+ """Notebooks"""
339
344
  ProxyCreate: grpc.UnaryUnaryMultiCallable[
340
345
  modal_proto.api_pb2.ProxyCreateRequest,
341
346
  modal_proto.api_pb2.ProxyCreateResponse,
@@ -1060,6 +1065,13 @@ class ModalClientServicer(metaclass=abc.ABCMeta):
1060
1065
  context: grpc.ServicerContext,
1061
1066
  ) -> modal_proto.api_pb2.MountPutFileResponse: ...
1062
1067
  @abc.abstractmethod
1068
+ def NotebookKernelPublishResults(
1069
+ self,
1070
+ request: modal_proto.api_pb2.NotebookKernelPublishResultsRequest,
1071
+ context: grpc.ServicerContext,
1072
+ ) -> google.protobuf.empty_pb2.Empty:
1073
+ """Notebooks"""
1074
+ @abc.abstractmethod
1063
1075
  def ProxyCreate(
1064
1076
  self,
1065
1077
  request: modal_proto.api_pb2.ProxyCreateRequest,
@@ -90,6 +90,7 @@ class ModalClientModal:
90
90
  self.ImageJoinStreaming = modal.client.UnaryStreamWrapper(grpclib_stub.ImageJoinStreaming, client)
91
91
  self.MountGetOrCreate = modal.client.UnaryUnaryWrapper(grpclib_stub.MountGetOrCreate, client)
92
92
  self.MountPutFile = modal.client.UnaryUnaryWrapper(grpclib_stub.MountPutFile, client)
93
+ self.NotebookKernelPublishResults = modal.client.UnaryUnaryWrapper(grpclib_stub.NotebookKernelPublishResults, client)
93
94
  self.ProxyCreate = modal.client.UnaryUnaryWrapper(grpclib_stub.ProxyCreate, client)
94
95
  self.ProxyDelete = modal.client.UnaryUnaryWrapper(grpclib_stub.ProxyDelete, client)
95
96
  self.ProxyGet = modal.client.UnaryUnaryWrapper(grpclib_stub.ProxyGet, client)
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 18 # git: 6608b5d
4
+ build_number = 19 # git: b81e8f9