baml-py 0.201.0__cp38-abi3-win_arm64.whl → 0.202.1__cp38-abi3-win_arm64.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
@@ -9,6 +9,8 @@ from .baml_py import (
9
9
  BamlImagePy as Image,
10
10
  BamlAudioPy as Audio,
11
11
  invoke_runtime_cli,
12
+ BamlPdfPy as Pdf,
13
+ BamlVideoPy as Video,
12
14
  ClientRegistry,
13
15
  # Collector utilities
14
16
  Collector,
@@ -31,6 +33,8 @@ __all__ = [
31
33
  "FunctionResultStream",
32
34
  "Image",
33
35
  "Audio",
36
+ "Pdf",
37
+ "Video",
34
38
  "invoke_runtime_cli",
35
39
  # Collector types
36
40
  "Collector",
baml_py/baml_py.pyd CHANGED
Binary file
baml_py/baml_py.pyi CHANGED
@@ -6,7 +6,9 @@ def get_version() -> str:
6
6
  """Get the version of the BAML Python client."""
7
7
  ...
8
8
 
9
- def set_log_level(level: Literal["DEBUG", "INFO", "WARN", "ERROR", "OFF"] | str) -> None:
9
+ def set_log_level(
10
+ level: Literal["DEBUG", "INFO", "WARN", "ERROR", "OFF"] | str,
11
+ ) -> None:
10
12
  """Set the log level for the BAML Python client."""
11
13
  ...
12
14
 
@@ -39,7 +41,13 @@ class FunctionResult:
39
41
  def __str__(self) -> str: ...
40
42
  # Returns True if the function call was successful, False otherwise
41
43
  def is_ok(self) -> bool: ...
42
- def cast_to(self, enum_module: Any, class_module: Any, partial_class_module: Any, allow_partials: bool) -> Any: ...
44
+ def cast_to(
45
+ self,
46
+ enum_module: Any,
47
+ class_module: Any,
48
+ partial_class_module: Any,
49
+ allow_partials: bool,
50
+ ) -> Any: ...
43
51
 
44
52
  # This is a debug function that returns the internal representation of the response
45
53
  # This is not to be relied upon and is subject to change
@@ -97,6 +105,26 @@ class BamlAudioPy:
97
105
  def as_url(self) -> str: ...
98
106
  def as_base64(self) -> Tuple[str, str]: ...
99
107
 
108
+ class BamlPdfPy:
109
+ @staticmethod
110
+ def from_url(url: str) -> BamlPdfPy: ...
111
+ @staticmethod
112
+ def from_base64(media_type: str, base64: str) -> BamlPdfPy: ...
113
+ def is_url(self) -> bool: ...
114
+ def is_base64(self) -> bool: ...
115
+ def as_url(self) -> str: ...
116
+ def as_base64(self) -> Tuple[str, str]: ...
117
+
118
+ class BamlVideoPy:
119
+ @staticmethod
120
+ def from_url(url: str) -> BamlVideoPy: ...
121
+ @staticmethod
122
+ def from_base64(media_type: str, base64: str) -> BamlVideoPy: ...
123
+ def is_url(self) -> bool: ...
124
+ def is_base64(self) -> bool: ...
125
+ def as_url(self) -> str: ...
126
+ def as_base64(self) -> Tuple[str, str]: ...
127
+
100
128
  class RuntimeContextManager:
101
129
  def upsert_tags(self, tags: Dict[str, Any]) -> None: ...
102
130
  def deep_clone(self) -> RuntimeContextManager: ...
@@ -196,7 +224,6 @@ class BamlRuntime:
196
224
  env_vars: Dict[str, str],
197
225
  ) -> Any: ...
198
226
 
199
-
200
227
  class LogEventMetadata:
201
228
  event_id: str
202
229
  parent_id: Optional[str]
@@ -280,7 +307,9 @@ class Collector:
280
307
  def __print_storage() -> None: ...
281
308
 
282
309
  class FunctionLog:
283
- def __init__(self, name: str, args: Dict[str, Any], result: FunctionResult) -> None: ...
310
+ def __init__(
311
+ self, name: str, args: Dict[str, Any], result: FunctionResult
312
+ ) -> None: ...
284
313
  def __str__(self) -> str: ...
285
314
  @property
286
315
  def id(self) -> str: ...
@@ -301,9 +330,16 @@ class FunctionLog:
301
330
  @property
302
331
  def selected_call(self) -> Optional[Union[LLMCall, LLMStreamCall]]: ...
303
332
 
304
-
305
333
  class LLMCall:
306
- def __init__(self, client_name: str, provider: str, timing: Timing, request: Dict[str, Any], response: Dict[str, Any], usage: Usage) -> None: ...
334
+ def __init__(
335
+ self,
336
+ client_name: str,
337
+ provider: str,
338
+ timing: Timing,
339
+ request: Dict[str, Any],
340
+ response: Dict[str, Any],
341
+ usage: Usage,
342
+ ) -> None: ...
307
343
  @property
308
344
  def selected(self) -> bool: ...
309
345
  @property
@@ -320,38 +356,80 @@ class LLMCall:
320
356
  @property
321
357
  def client_name(self) -> str: ...
322
358
 
359
+ class LLMStreamCall:
360
+ def __init__(
361
+ self,
362
+ client_name: str,
363
+ provider: str,
364
+ timing: StreamTiming,
365
+ request: Dict[str, Any],
366
+ response: Dict[str, Any],
367
+ usage: Usage,
368
+ ) -> None: ...
369
+ @property
370
+ def selected(self) -> bool: ...
371
+ @property
372
+ def http_request(self) -> Optional[HTTPRequest]: ...
373
+ @property
374
+ def http_response(self) -> Optional[HTTPResponse]: ...
375
+ @property
376
+ def usage(self) -> Usage: ...
377
+ @property
378
+ def timing(self) -> Timing: ...
379
+ @property
380
+ def provider(self) -> str: ...
323
381
 
324
- class LLMStreamCall(LLMCall):
325
- def __init__(self, client_name: str, provider: str, timing: StreamTiming, request: Dict[str, Any], response: Dict[str, Any],
326
- usage: Usage) -> None: ...
327
- # TODO: add chunks
328
- # def chunks(self) -> List[str]: ...
382
+ # The baml client name / clientregistry name
383
+ @property
384
+ def client_name(self) -> str: ...
329
385
  @property
330
386
  def timing(self) -> StreamTiming: ...
387
+ def sse_responses(self) -> Optional[List[SSEResponse]]: ...
388
+
389
+ class SSEResponse:
390
+ @property
391
+ def text(self) -> str: ...
392
+ def json(self) -> Optional[Any]: ...
331
393
 
332
394
  class Usage:
333
- def __init__(self, input_tokens: Optional[int], output_tokens: Optional[int]) -> None: ...
395
+ def __init__(
396
+ self, input_tokens: Optional[int], output_tokens: Optional[int]
397
+ ) -> None: ...
334
398
  @property
335
399
  def input_tokens(self) -> Optional[int]: ...
336
400
  @property
337
401
  def output_tokens(self) -> Optional[int]: ...
338
402
 
339
403
  class Timing:
340
- def __init__(self, start_time: str, end_time: str, duration: Optional[int], time_to_first_parsed_ms: Optional[int]) -> None: ...
404
+ def __init__(
405
+ self,
406
+ start_time: str,
407
+ end_time: str,
408
+ duration: Optional[int],
409
+ time_to_first_parsed_ms: Optional[int],
410
+ ) -> None: ...
341
411
  @property
342
412
  def start_time_utc_ms(self) -> int: ...
343
413
  @property
344
414
  def duration_ms(self) -> Optional[int]: ...
345
- @property
346
- def time_to_first_parsed_ms(self) -> Optional[int]: ...
347
415
 
348
416
  class StreamTiming(Timing):
349
- def __init__(self, start_time_utc_ms: int, duration_ms: int, time_to_first_parsed_ms: int, time_to_first_token_ms: int) -> None: ...
417
+ def __init__(
418
+ self,
419
+ start_time_utc_ms: int,
420
+ duration_ms: int,
421
+ time_to_first_parsed_ms: int,
422
+ time_to_first_token_ms: int,
423
+ ) -> None: ...
424
+ @property
425
+ def start_time_utc_ms(self) -> int: ...
350
426
  @property
351
- def time_to_first_token_ms(self) -> Optional[int]: ...
427
+ def duration_ms(self) -> Optional[int]: ...
352
428
 
353
429
  class HTTPRequest:
354
- def __init__(self, url: str, method: str, headers: Dict[str, Any], body: str) -> None: ...
430
+ def __init__(
431
+ self, url: str, method: str, headers: Dict[str, Any], body: str
432
+ ) -> None: ...
355
433
  @property
356
434
  def id(self) -> str: ...
357
435
  @property
baml_py/safe_import.py CHANGED
@@ -66,7 +66,7 @@ https://boundaryml.com/discord
66
66
  raise ImportError(f"""
67
67
  {msg}
68
68
 
69
- Please upgrade baml-py to version "{target_version}".
69
+ Please set baml-py to version "{target_version}".
70
70
 
71
71
  $ pip install {self._target_package_name()}
72
72
  $ uv add {self._target_package_name()}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: baml-py
3
- Version: 0.201.0
3
+ Version: 0.202.1
4
4
  License-File: LICENSE
5
5
  Summary: BAML python bindings (pyproject.toml)
6
6
  Author: Boundary <contact@boundaryml.com>
@@ -0,0 +1,16 @@
1
+ baml_py-0.202.1.dist-info/METADATA,sha256=MyU0gcPBwALw-N2plZC0M8Eg6N_WvZLFyRzkXxo-BDg,336
2
+ baml_py-0.202.1.dist-info/WHEEL,sha256=brtZzFSYSpN-7dgVTVyZRllMDwYqodWyQDQRZMiNrIo,94
3
+ baml_py-0.202.1.dist-info/entry_points.txt,sha256=9Uu_VcUjoI2qQMjVb0PRjEgI6pQ55WqBbzNparAPJyA,54
4
+ baml_py-0.202.1.dist-info/licenses/LICENSE,sha256=WtjCEwlcVzkh1ziO35P2qfVEkLjr87Flro7xlHz3CEY,11556
5
+ baml_py/__init__.py,sha256=0Nnk5nLOhfu7whIfBsWUkXWyBnRl2QuyGQVfoi3ia0c,945
6
+ baml_py/baml_py.pyd,sha256=oOsJFZk5djCddcG2U1KiZdbQcdmsIeKZF2VCjg1o4a0,41475584
7
+ baml_py/baml_py.pyi,sha256=oXK82Wzd5lJEzGhWDmOPoXV3QoKuvBnmEPUQCp0hIwU,15974
8
+ baml_py/ctx_manager.py,sha256=KLsEi-clqnabNKR-R2hCoBd3SxY5uxZqBl1AFgfejng,6268
9
+ baml_py/errors.py,sha256=Qesr_IinnvsmRAw-hkExlLcFKvY4Zyi66JGoujxJ-sM,409
10
+ baml_py/internal_monkeypatch.py,sha256=eX9LK0xtZqVpWYhCEqLPqYmP2NKzharE5j64h7CFFxI,2155
11
+ baml_py/logging.py,sha256=x5sJibE7KfT4YsnNgmyXbhzHu4xOwLtc4trbYHsYmzc,193
12
+ baml_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ baml_py/safe_import.py,sha256=gV6nMqBx-O6INutLxGSdfKzgtICx4WjXV40uz_NKwhQ,2971
14
+ baml_py/stream.py,sha256=cY9biE_V3SqOEQFqWTttW3wPOh7RhOHOD1fDifEylR8,7068
15
+ baml_py/type_builder.py,sha256=0VhIU1sA5IgFksKN9rMWWXRtsKE8MX4i8qosvGdMtG0,6578
16
+ baml_py-0.202.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.9.0)
2
+ Generator: maturin (1.9.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-abi3-win_arm64
@@ -1,16 +0,0 @@
1
- baml_py-0.201.0.dist-info/METADATA,sha256=dlREla8THs9NMhe51vOyLCLQzxOE7nrkWICjV6nNZeE,336
2
- baml_py-0.201.0.dist-info/WHEEL,sha256=bJVluvRCzevgnqQwri7z33LPshy2FtyoozeY5cUvjgQ,94
3
- baml_py-0.201.0.dist-info/entry_points.txt,sha256=9Uu_VcUjoI2qQMjVb0PRjEgI6pQ55WqBbzNparAPJyA,54
4
- baml_py-0.201.0.dist-info/licenses/LICENSE,sha256=WtjCEwlcVzkh1ziO35P2qfVEkLjr87Flro7xlHz3CEY,11556
5
- baml_py/__init__.py,sha256=goPPklYWODB3Bi7g3AxHInixcRAvLSUS_aC2nMd8NLg,869
6
- baml_py/baml_py.pyd,sha256=eH_c55LKPg-5JTIk29Uk0u9VMctkcTTTFJK1PONwInE,39216128
7
- baml_py/baml_py.pyi,sha256=Ge26n3ilsCvFeshf5KB4_nZMt9VOtGCJNcd1IGbz7E8,14430
8
- baml_py/ctx_manager.py,sha256=KLsEi-clqnabNKR-R2hCoBd3SxY5uxZqBl1AFgfejng,6268
9
- baml_py/errors.py,sha256=Qesr_IinnvsmRAw-hkExlLcFKvY4Zyi66JGoujxJ-sM,409
10
- baml_py/internal_monkeypatch.py,sha256=eX9LK0xtZqVpWYhCEqLPqYmP2NKzharE5j64h7CFFxI,2155
11
- baml_py/logging.py,sha256=x5sJibE7KfT4YsnNgmyXbhzHu4xOwLtc4trbYHsYmzc,193
12
- baml_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- baml_py/safe_import.py,sha256=rZe6oMYrESyNTkkkpuPsJKBloqzF5EAio3T2Zl9WqXg,2975
14
- baml_py/stream.py,sha256=cY9biE_V3SqOEQFqWTttW3wPOh7RhOHOD1fDifEylR8,7068
15
- baml_py/type_builder.py,sha256=0VhIU1sA5IgFksKN9rMWWXRtsKE8MX4i8qosvGdMtG0,6578
16
- baml_py-0.201.0.dist-info/RECORD,,