baml-py 0.203.1__cp38-abi3-musllinux_1_1_aarch64.whl → 0.204.0__cp38-abi3-musllinux_1_1_aarch64.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/baml_py.abi3.so +0 -0
- baml_py/baml_py.pyi +6 -0
- baml_py/type_builder.py +10 -25
- {baml_py-0.203.1.dist-info → baml_py-0.204.0.dist-info}/METADATA +1 -1
- {baml_py-0.203.1.dist-info → baml_py-0.204.0.dist-info}/RECORD +8 -8
- {baml_py-0.203.1.dist-info → baml_py-0.204.0.dist-info}/WHEEL +1 -1
- {baml_py-0.203.1.dist-info → baml_py-0.204.0.dist-info}/entry_points.txt +0 -0
- {baml_py-0.203.1.dist-info → baml_py-0.204.0.dist-info}/licenses/LICENSE +0 -0
baml_py/baml_py.abi3.so
CHANGED
Binary file
|
baml_py/baml_py.pyi
CHANGED
@@ -275,6 +275,7 @@ class BamlSpan:
|
|
275
275
|
|
276
276
|
class TypeBuilder:
|
277
277
|
def __init__(self) -> None: ...
|
278
|
+
def reset(self) -> None: ...
|
278
279
|
def enum(self, name: str) -> EnumBuilder: ...
|
279
280
|
def class_(self, name: str) -> ClassBuilder: ...
|
280
281
|
def string(self) -> FieldType: ...
|
@@ -470,6 +471,7 @@ class ClientRegistry:
|
|
470
471
|
class FieldType:
|
471
472
|
def list(self) -> FieldType: ...
|
472
473
|
def optional(self) -> FieldType: ...
|
474
|
+
def __eq__(self, other: object) -> bool: ...
|
473
475
|
|
474
476
|
class EnumBuilder:
|
475
477
|
def value(self, name: str) -> EnumValueBuilder: ...
|
@@ -483,10 +485,14 @@ class EnumValueBuilder:
|
|
483
485
|
|
484
486
|
class ClassBuilder:
|
485
487
|
def field(self) -> FieldType: ...
|
488
|
+
def list_properties(self) -> List[Tuple[str, ClassPropertyBuilder]]: ...
|
486
489
|
def property(self, name: str) -> ClassPropertyBuilder: ...
|
490
|
+
def remove_property(self, name: str) -> None: ...
|
491
|
+
def reset(self) -> None: ...
|
487
492
|
|
488
493
|
class ClassPropertyBuilder:
|
489
494
|
def type(self, field_type: FieldType) -> ClassPropertyBuilder: ...
|
495
|
+
def get_type(self) -> FieldType: ...
|
490
496
|
def alias(self, alias: Optional[str]) -> ClassPropertyBuilder: ...
|
491
497
|
def description(self, description: Optional[str]) -> ClassPropertyBuilder: ...
|
492
498
|
|
baml_py/type_builder.py
CHANGED
@@ -19,6 +19,9 @@ class TypeBuilder:
|
|
19
19
|
self.__tb = _TypeBuilder()
|
20
20
|
self.__runtime = runtime
|
21
21
|
|
22
|
+
def reset(self):
|
23
|
+
self.__tb.reset()
|
24
|
+
|
22
25
|
def __str__(self) -> str:
|
23
26
|
"""
|
24
27
|
returns a comprehensive string representation of the typebuilder.
|
@@ -111,29 +114,22 @@ class TypeBuilder:
|
|
111
114
|
class NewClassBuilder:
|
112
115
|
def __init__(self, tb: _TypeBuilder, name: str):
|
113
116
|
self.__bldr = tb.class_(name)
|
114
|
-
self.__properties: typing.Set[str] = set()
|
115
|
-
self.__props = NewClassProperties(self.__bldr, self.__properties)
|
116
117
|
|
117
118
|
def type(self) -> FieldType:
|
118
119
|
return self.__bldr.field()
|
119
120
|
|
120
121
|
def list_properties(self) -> typing.List[typing.Tuple[str, "ClassPropertyBuilder"]]:
|
121
|
-
return
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
return self.__bldr.list_properties()
|
123
|
+
|
124
|
+
def reset(self):
|
125
|
+
self.__bldr.reset()
|
126
|
+
|
127
|
+
def remove_property(self, name: str):
|
128
|
+
self.__bldr.remove_property(name)
|
125
129
|
|
126
130
|
def add_property(self, name: str, type: FieldType) -> "ClassPropertyBuilder":
|
127
|
-
if name in self.__properties:
|
128
|
-
raise ValueError(f"Property {name} already exists.")
|
129
|
-
# BUG: we don't add to self.__properties here
|
130
|
-
# correct fix is to implement this logic in rust, not python
|
131
131
|
return ClassPropertyBuilder(self.__bldr.property(name).type(type))
|
132
132
|
|
133
|
-
@property
|
134
|
-
def props(self) -> "NewClassProperties":
|
135
|
-
return self.__props
|
136
|
-
|
137
133
|
|
138
134
|
class ClassPropertyBuilder:
|
139
135
|
def __init__(self, bldr: _ClassPropertyBuilder):
|
@@ -153,17 +149,6 @@ class ClassPropertyViewer:
|
|
153
149
|
self.__bldr = bldr
|
154
150
|
|
155
151
|
|
156
|
-
class NewClassProperties:
|
157
|
-
def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]):
|
158
|
-
self.__bldr = cls_bldr
|
159
|
-
self.__properties = properties
|
160
|
-
|
161
|
-
def __getattr__(self, name: str) -> "ClassPropertyBuilder":
|
162
|
-
if name not in self.__properties:
|
163
|
-
raise AttributeError(f"Property {name} not found.")
|
164
|
-
return ClassPropertyBuilder(self.__bldr.property(name))
|
165
|
-
|
166
|
-
|
167
152
|
class NewEnumBuilder:
|
168
153
|
def __init__(self, tb: _TypeBuilder, name: str):
|
169
154
|
self.__bldr = tb.enum(name)
|
@@ -1,11 +1,11 @@
|
|
1
|
-
baml_py-0.
|
2
|
-
baml_py-0.
|
3
|
-
baml_py-0.
|
4
|
-
baml_py-0.
|
1
|
+
baml_py-0.204.0.dist-info/METADATA,sha256=zKv1tSF-R_g6Ki-sHKY5KILNj5qaV5mnv_HZDa6xnMs,273
|
2
|
+
baml_py-0.204.0.dist-info/WHEEL,sha256=Unc__yfpLPdGLWMHgmpMTpBqYAY-pq-hD0OzhWabcCI,106
|
3
|
+
baml_py-0.204.0.dist-info/entry_points.txt,sha256=9Uu_VcUjoI2qQMjVb0PRjEgI6pQ55WqBbzNparAPJyA,54
|
4
|
+
baml_py-0.204.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
5
5
|
baml_py.libs/libgcc_s-e52197c3.so.1,sha256=vkPW1Auw6CH9Bjk7frmX3hry_1H9c0tRI0Ncyg71WUI,724137
|
6
6
|
baml_py/__init__.py,sha256=wBCtTkuBrwFdfo7AVI5Bxu81lh1wQgcfOU9bkkYAHAk,899
|
7
|
-
baml_py/baml_py.abi3.so,sha256=
|
8
|
-
baml_py/baml_py.pyi,sha256=
|
7
|
+
baml_py/baml_py.abi3.so,sha256=MIDLyQ1pWBK604JdDPHjyUdKFrUT71ajK3IfhxEpcHE,52237577
|
8
|
+
baml_py/baml_py.pyi,sha256=jqSIfnsL2pKGPHJz_U_VrviWP3FErnOT-6TOCCrCefY,15748
|
9
9
|
baml_py/ctx_manager.py,sha256=JwWLvxFT05BnYiguzB-k-g47r7mft74L3mYt8e3qtus,6081
|
10
10
|
baml_py/errors.py,sha256=wqv7xT_-pVXQNxD5JbOrrr_CABCFuNrLrEhmEX8RVJ8,389
|
11
11
|
baml_py/internal_monkeypatch.py,sha256=JDwBPw4S8veD3nvJ13lFw8P5p29UOmDvvkgOy8eKA58,2106
|
@@ -13,5 +13,5 @@ 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
|
-
baml_py/type_builder.py,sha256=
|
17
|
-
baml_py-0.
|
16
|
+
baml_py/type_builder.py,sha256=wDrMuEr2-9r2rjFbNOXIGf2g-zdd6y3n7jlb8cFNHZc,5615
|
17
|
+
baml_py-0.204.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|