baml-py 0.204.0__cp38-abi3-musllinux_1_1_x86_64.whl → 0.206.0__cp38-abi3-musllinux_1_1_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 +2 -0
- baml_py/baml_py.abi3.so +0 -0
- baml_py/baml_py.pyi +35 -1
- baml_py/errors.py +2 -0
- {baml_py-0.204.0.dist-info → baml_py-0.206.0.dist-info}/METADATA +2 -1
- {baml_py-0.204.0.dist-info → baml_py-0.206.0.dist-info}/RECORD +9 -9
- {baml_py-0.204.0.dist-info → baml_py-0.206.0.dist-info}/WHEEL +1 -1
- {baml_py-0.204.0.dist-info → baml_py-0.206.0.dist-info}/entry_points.txt +0 -0
- {baml_py-0.204.0.dist-info → baml_py-0.206.0.dist-info}/licenses/LICENSE +0 -0
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(
|
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: ...
|
@@ -223,6 +256,7 @@ class BamlRuntime:
|
|
223
256
|
cr: Optional[ClientRegistry],
|
224
257
|
env_vars: Dict[str, str],
|
225
258
|
) -> Any: ...
|
259
|
+
def disassemble(self, function_name: str) -> None: ...
|
226
260
|
|
227
261
|
class LogEventMetadata:
|
228
262
|
event_id: str
|
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.
|
3
|
+
Version: 0.206.0
|
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)
|
@@ -1,17 +1,17 @@
|
|
1
|
-
baml_py-0.
|
2
|
-
baml_py-0.
|
3
|
-
baml_py-0.
|
4
|
-
baml_py-0.
|
1
|
+
baml_py-0.206.0.dist-info/METADATA,sha256=FcHOfHQpdx-ToGTRxWz4zHHiJeAz1S3YNOCwibVs_dc,304
|
2
|
+
baml_py-0.206.0.dist-info/WHEEL,sha256=RyuTMqZ-GvVRmySrlkZCJvWJb4QsexmNN-AIFn-SgE4,105
|
3
|
+
baml_py-0.206.0.dist-info/entry_points.txt,sha256=9Uu_VcUjoI2qQMjVb0PRjEgI6pQ55WqBbzNparAPJyA,54
|
4
|
+
baml_py-0.206.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
5
5
|
baml_py.libs/libgcc_s-1e52349c.so.1,sha256=Ani0u_W_tB8ESsFePO4D2mn2lrgWLhyFdw6RETxBTYM,437537
|
6
|
-
baml_py/__init__.py,sha256=
|
7
|
-
baml_py/baml_py.abi3.so,sha256=
|
8
|
-
baml_py/baml_py.pyi,sha256=
|
6
|
+
baml_py/__init__.py,sha256=_tXffmw8Be3rMDR8Zfivr1Gp-wL7baJ-guSoIRaOsBY,943
|
7
|
+
baml_py/baml_py.abi3.so,sha256=YA5k5FlyiLm6IHG_XAt768zgFCJbpxb2Xj8UA4sIE0I,57586913
|
8
|
+
baml_py/baml_py.pyi,sha256=ha8JgEp2Sg45s_8Eu7OjWq29FMct4GqFQ7zOVs4Qt0Y,16794
|
9
9
|
baml_py/ctx_manager.py,sha256=JwWLvxFT05BnYiguzB-k-g47r7mft74L3mYt8e3qtus,6081
|
10
|
-
baml_py/errors.py,sha256=
|
10
|
+
baml_py/errors.py,sha256=cpD5OlBuKIX8IbImwM_VgHzTz0gJqZJMhnEulXEajAE,431
|
11
11
|
baml_py/internal_monkeypatch.py,sha256=JDwBPw4S8veD3nvJ13lFw8P5p29UOmDvvkgOy8eKA58,2106
|
12
12
|
baml_py/logging.py,sha256=zM-yKPJ3LF4qpIptYQVr5zw_Gjimy3deWlTt4dOzVp0,190
|
13
13
|
baml_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
baml_py/safe_import.py,sha256=ELnT9Jp1Z9ZqLZkbfmqYZ0vJpF-5dc2yshpryqn1UXE,2884
|
15
15
|
baml_py/stream.py,sha256=pNfXDOa-6u4cjANaq071I6AevUx9N7DhDORc18Vh03k,6881
|
16
16
|
baml_py/type_builder.py,sha256=wDrMuEr2-9r2rjFbNOXIGf2g-zdd6y3n7jlb8cFNHZc,5615
|
17
|
-
baml_py-0.
|
17
|
+
baml_py-0.206.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|