baml-py 0.205.0__cp38-abi3-macosx_10_12_x86_64.whl → 0.206.1__cp38-abi3-macosx_10_12_x86_64.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.
baml_py/__init__.py CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  # Re-export the pyo3 API
5
5
  from .baml_py import (
6
+ AbortController,
6
7
  BamlRuntime,
7
8
  FunctionResult,
8
9
  FunctionResultStream,
@@ -24,6 +25,7 @@ from .stream import BamlStream, BamlSyncStream
24
25
  from .ctx_manager import CtxManager as BamlCtxManager
25
26
 
26
27
  __all__ = [
28
+ "AbortController",
27
29
  "BamlRuntime",
28
30
  "ClientRegistry",
29
31
  "BamlStream",
baml_py/baml_py.abi3.so CHANGED
Binary file
baml_py/baml_py.pyi CHANGED
@@ -2,6 +2,8 @@ from __future__ import annotations
2
2
  from typing_extensions import Literal
3
3
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
4
4
 
5
+ TickReason = Literal["Unknown"]
6
+
5
7
  def get_version() -> str:
6
8
  """Get the version of the BAML Python client."""
7
9
  ...
@@ -24,6 +26,35 @@ def set_log_max_chunk_length(length: int) -> None:
24
26
  """Set the maximum log chunk length for the BAML Python client."""
25
27
  ...
26
28
 
29
+ class AbortController:
30
+ """Controller for cancelling BAML operations."""
31
+
32
+ def __init__(self, timeout_ms: Optional[int] = None) -> None:
33
+ """
34
+ Creates a new abort controller with an optional timeout in milliseconds.
35
+ Once aborted, the AbortController will forever remain in an an aborted state.
36
+ The timeout will only start AFTER the object is passed to a BAML function.
37
+
38
+ Args:
39
+ timeout_ms: The timeout in milliseconds. If not provided, AbortController will not timeout.
40
+ """
41
+ ...
42
+
43
+
44
+ def abort(self) -> None:
45
+ """
46
+ Immediately abort all operations.
47
+ """
48
+ ...
49
+
50
+ @property
51
+ def aborted(self) -> bool:
52
+ """
53
+ Check the state of this controller.
54
+ Once aborted, the AbortController will forever remain in an an aborted state.
55
+ """
56
+ ...
57
+
27
58
  class FunctionResult:
28
59
  """The result of a BAML function call.
29
60
 
@@ -109,7 +140,7 @@ class BamlPdfPy:
109
140
  @staticmethod
110
141
  def from_url(url: str) -> BamlPdfPy: ...
111
142
  @staticmethod
112
- def from_base64(media_type: str, base64: str) -> BamlPdfPy: ...
143
+ def from_base64(base64: str) -> BamlPdfPy: ...
113
144
  def is_url(self) -> bool: ...
114
145
  def is_base64(self) -> bool: ...
115
146
  def as_url(self) -> str: ...
@@ -172,6 +203,7 @@ class BamlRuntime:
172
203
  cr: Optional[ClientRegistry],
173
204
  collectors: List[Collector],
174
205
  env_vars: Dict[str, str],
206
+ on_tick: Optional[Callable[[], None]],
175
207
  ) -> FunctionResultStream: ...
176
208
  def stream_function_sync(
177
209
  self,
@@ -183,6 +215,7 @@ class BamlRuntime:
183
215
  cr: Optional[ClientRegistry],
184
216
  collectors: List[Collector],
185
217
  env_vars: Dict[str, str],
218
+ on_tick: Optional[Callable[[], None]],
186
219
  ) -> SyncFunctionResultStream: ...
187
220
  def create_context_manager(self) -> RuntimeContextManager: ...
188
221
  def flush(self) -> None: ...
baml_py/errors.py CHANGED
@@ -1,4 +1,5 @@
1
1
  from .baml_py import (
2
+ BamlAbortError,
2
3
  BamlError,
3
4
  BamlClientError,
4
5
  BamlInvalidArgumentError,
@@ -11,6 +12,7 @@ from .internal_monkeypatch import (
11
12
 
12
13
 
13
14
  __all__ = [
15
+ "BamlAbortError",
14
16
  "BamlError",
15
17
  "BamlClientError",
16
18
  "BamlClientHttpError",
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: baml-py
3
- Version: 0.205.0
3
+ Version: 0.206.1
4
4
  License-File: LICENSE
5
5
  Summary: BAML python bindings (pyproject.toml)
6
6
  Author-email: Boundary <contact@boundaryml.com>
7
+ License-Expression: Apache-2.0
7
8
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
8
9
 
9
10
  BAML python bindings (readme.md)
@@ -0,0 +1,16 @@
1
+ baml_py-0.206.1.dist-info/METADATA,sha256=S0h1SPO7xQ2IYpOwDAY__wZI6nITNL8bvSnZVuzu9jw,304
2
+ baml_py-0.206.1.dist-info/WHEEL,sha256=qq8T5RNN4nLzVDHWhr9aubnbXTyL36gsBivIyKvr8Qc,104
3
+ baml_py-0.206.1.dist-info/entry_points.txt,sha256=9Uu_VcUjoI2qQMjVb0PRjEgI6pQ55WqBbzNparAPJyA,54
4
+ baml_py-0.206.1.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
5
+ baml_py/__init__.py,sha256=_tXffmw8Be3rMDR8Zfivr1Gp-wL7baJ-guSoIRaOsBY,943
6
+ baml_py/baml_py.abi3.so,sha256=-WeG3cDc8jdikC7fLLoIX9M6QZX2-Bg9QEgswJ6Aok8,47641576
7
+ baml_py/baml_py.pyi,sha256=ha8JgEp2Sg45s_8Eu7OjWq29FMct4GqFQ7zOVs4Qt0Y,16794
8
+ baml_py/ctx_manager.py,sha256=JwWLvxFT05BnYiguzB-k-g47r7mft74L3mYt8e3qtus,6081
9
+ baml_py/errors.py,sha256=cpD5OlBuKIX8IbImwM_VgHzTz0gJqZJMhnEulXEajAE,431
10
+ baml_py/internal_monkeypatch.py,sha256=JDwBPw4S8veD3nvJ13lFw8P5p29UOmDvvkgOy8eKA58,2106
11
+ baml_py/logging.py,sha256=zM-yKPJ3LF4qpIptYQVr5zw_Gjimy3deWlTt4dOzVp0,190
12
+ baml_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ baml_py/safe_import.py,sha256=ELnT9Jp1Z9ZqLZkbfmqYZ0vJpF-5dc2yshpryqn1UXE,2884
14
+ baml_py/stream.py,sha256=pNfXDOa-6u4cjANaq071I6AevUx9N7DhDORc18Vh03k,6881
15
+ baml_py/type_builder.py,sha256=wDrMuEr2-9r2rjFbNOXIGf2g-zdd6y3n7jlb8cFNHZc,5615
16
+ baml_py-0.206.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.9.3)
2
+ Generator: maturin (1.9.4)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-abi3-macosx_10_12_x86_64
@@ -1,16 +0,0 @@
1
- baml_py-0.205.0.dist-info/METADATA,sha256=8TuKollgGGupzfJaYYp4dGn2PGyFPoFWYCcJOsIgTWU,273
2
- baml_py-0.205.0.dist-info/WHEEL,sha256=hrXQVN4B0_e2LlpfUhUjieHy374NCAldv7m_G8ccdFw,104
3
- baml_py-0.205.0.dist-info/entry_points.txt,sha256=9Uu_VcUjoI2qQMjVb0PRjEgI6pQ55WqBbzNparAPJyA,54
4
- baml_py-0.205.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
5
- baml_py/__init__.py,sha256=wBCtTkuBrwFdfo7AVI5Bxu81lh1wQgcfOU9bkkYAHAk,899
6
- baml_py/baml_py.abi3.so,sha256=tnVtKt8V8SSeOhyr1NqbkdsVy5jh3ZDSVBOa_ZjT1M8,47000424
7
- baml_py/baml_py.pyi,sha256=tGFuSIOaU6AhqK_g7eRJevuZ48DTlAp4bRbqaad067E,15807
8
- baml_py/ctx_manager.py,sha256=JwWLvxFT05BnYiguzB-k-g47r7mft74L3mYt8e3qtus,6081
9
- baml_py/errors.py,sha256=wqv7xT_-pVXQNxD5JbOrrr_CABCFuNrLrEhmEX8RVJ8,389
10
- baml_py/internal_monkeypatch.py,sha256=JDwBPw4S8veD3nvJ13lFw8P5p29UOmDvvkgOy8eKA58,2106
11
- baml_py/logging.py,sha256=zM-yKPJ3LF4qpIptYQVr5zw_Gjimy3deWlTt4dOzVp0,190
12
- baml_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- baml_py/safe_import.py,sha256=ELnT9Jp1Z9ZqLZkbfmqYZ0vJpF-5dc2yshpryqn1UXE,2884
14
- baml_py/stream.py,sha256=pNfXDOa-6u4cjANaq071I6AevUx9N7DhDORc18Vh03k,6881
15
- baml_py/type_builder.py,sha256=wDrMuEr2-9r2rjFbNOXIGf2g-zdd6y3n7jlb8cFNHZc,5615
16
- baml_py-0.205.0.dist-info/RECORD,,