lionagi 0.8.1__py3-none-any.whl → 0.8.2__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.
- lionagi/operatives/models/field_model.py +39 -22
- lionagi/operatives/models/model_params.py +35 -16
- lionagi/operatives/models/note.py +84 -45
- lionagi/operatives/models/operable_model.py +118 -8
- lionagi/version.py +1 -1
- {lionagi-0.8.1.dist-info → lionagi-0.8.2.dist-info}/METADATA +1 -1
- {lionagi-0.8.1.dist-info → lionagi-0.8.2.dist-info}/RECORD +9 -9
- {lionagi-0.8.1.dist-info → lionagi-0.8.2.dist-info}/WHEEL +0 -0
- {lionagi-0.8.1.dist-info → lionagi-0.8.2.dist-info}/licenses/LICENSE +0 -0
@@ -27,23 +27,23 @@ class FieldModel(SchemaModel):
|
|
27
27
|
configuration options including type validation, default values, documentation,
|
28
28
|
and validation rules.
|
29
29
|
|
30
|
-
|
31
|
-
name
|
32
|
-
annotation
|
33
|
-
default
|
34
|
-
default_factory
|
35
|
-
validator
|
36
|
-
validator_kwargs
|
37
|
-
title
|
38
|
-
description
|
39
|
-
examples
|
40
|
-
exclude
|
41
|
-
deprecated
|
42
|
-
frozen
|
43
|
-
alias
|
44
|
-
alias_priority
|
45
|
-
|
46
|
-
|
30
|
+
Args:
|
31
|
+
name: Required field identifier.
|
32
|
+
annotation: Field type annotation. Defaults to Any.
|
33
|
+
default: Default value for the field.
|
34
|
+
default_factory: Function to generate default values.
|
35
|
+
validator: Optional validation function.
|
36
|
+
validator_kwargs: Parameters for validator configuration.
|
37
|
+
title: Human-readable field title.
|
38
|
+
description: Detailed field description.
|
39
|
+
examples: Example values for documentation.
|
40
|
+
exclude: Whether to exclude from serialization.
|
41
|
+
deprecated: Whether the field is deprecated.
|
42
|
+
frozen: Whether the field is immutable.
|
43
|
+
alias: Alternative field name.
|
44
|
+
alias_priority: Priority for alias resolution.
|
45
|
+
|
46
|
+
Examples:
|
47
47
|
>>> field = FieldModel(
|
48
48
|
... name="age",
|
49
49
|
... annotation=int,
|
@@ -129,7 +129,14 @@ class FieldModel(SchemaModel):
|
|
129
129
|
|
130
130
|
@field_validator("validator_kwargs", mode="before")
|
131
131
|
def _validate_validator_kwargs(cls, value):
|
132
|
-
"""Validate validator kwargs.
|
132
|
+
"""Validate validator kwargs.
|
133
|
+
|
134
|
+
Args:
|
135
|
+
value: Validator kwargs to validate.
|
136
|
+
|
137
|
+
Returns:
|
138
|
+
Validated kwargs dictionary.
|
139
|
+
"""
|
133
140
|
return validate_dict_kwargs_params(cls, value)
|
134
141
|
|
135
142
|
@field_validator("validator", mode="before")
|
@@ -140,7 +147,7 @@ class FieldModel(SchemaModel):
|
|
140
147
|
value: Validator function to check.
|
141
148
|
|
142
149
|
Returns:
|
143
|
-
|
150
|
+
Validated validator function.
|
144
151
|
|
145
152
|
Raises:
|
146
153
|
ValueError: If validator is not callable.
|
@@ -151,8 +158,11 @@ class FieldModel(SchemaModel):
|
|
151
158
|
def field_info(self) -> FieldInfo:
|
152
159
|
"""Generate Pydantic FieldInfo from current configuration.
|
153
160
|
|
161
|
+
Converts the current field configuration into a Pydantic FieldInfo object,
|
162
|
+
handling annotation defaults and field attributes.
|
163
|
+
|
154
164
|
Returns:
|
155
|
-
|
165
|
+
Configured Pydantic FieldInfo object.
|
156
166
|
"""
|
157
167
|
annotation = (
|
158
168
|
self.annotation if self.annotation is not UNDEFINED else Any
|
@@ -165,8 +175,12 @@ class FieldModel(SchemaModel):
|
|
165
175
|
def field_validator(self) -> dict[str, Callable] | None:
|
166
176
|
"""Create field validator configuration.
|
167
177
|
|
178
|
+
Generates a validator configuration dictionary if a validator function
|
179
|
+
is defined, otherwise returns None.
|
180
|
+
|
168
181
|
Returns:
|
169
|
-
|
182
|
+
Dictionary mapping validator name to validator function if defined,
|
183
|
+
None otherwise.
|
170
184
|
"""
|
171
185
|
if self.validator is UNDEFINED:
|
172
186
|
return None
|
@@ -181,8 +195,11 @@ class FieldModel(SchemaModel):
|
|
181
195
|
def _validate_defaults(self) -> Self:
|
182
196
|
"""Ensure default value configuration is valid.
|
183
197
|
|
198
|
+
Validates that default and default_factory are not both set, as this
|
199
|
+
would create ambiguity about which default to use.
|
200
|
+
|
184
201
|
Returns:
|
185
|
-
|
202
|
+
The validated model instance.
|
186
203
|
|
187
204
|
Raises:
|
188
205
|
ValueError: If both default and default_factory are set.
|
@@ -39,17 +39,28 @@ class ModelParams(SchemaModel):
|
|
39
39
|
fields, validators, and configurations. It supports inheritance from base
|
40
40
|
models, field exclusion, and custom validation rules.
|
41
41
|
|
42
|
-
|
43
|
-
name
|
44
|
-
parameter_fields
|
45
|
-
base_type
|
46
|
-
field_models
|
47
|
-
exclude_fields
|
48
|
-
field_descriptions
|
49
|
-
inherit_base
|
50
|
-
config_dict
|
51
|
-
doc
|
52
|
-
frozen
|
42
|
+
Args:
|
43
|
+
name: Name for the generated model class.
|
44
|
+
parameter_fields: Field definitions for the model.
|
45
|
+
base_type: Base model class to inherit from.
|
46
|
+
field_models: List of field model definitions.
|
47
|
+
exclude_fields: Fields to exclude from the final model.
|
48
|
+
field_descriptions: Custom descriptions for fields.
|
49
|
+
inherit_base: Whether to inherit from base_type.
|
50
|
+
config_dict: Pydantic model configuration.
|
51
|
+
doc: Docstring for the generated model.
|
52
|
+
frozen: Whether the model should be immutable.
|
53
|
+
|
54
|
+
Examples:
|
55
|
+
>>> params = ModelParams(
|
56
|
+
... name="UserModel",
|
57
|
+
... field_models=[
|
58
|
+
... FieldModel(name="username", annotation=str),
|
59
|
+
... FieldModel(name="age", annotation=int, default=0)
|
60
|
+
... ],
|
61
|
+
... doc="A user model with basic attributes."
|
62
|
+
... )
|
63
|
+
>>> UserModel = params.create_new_model()
|
53
64
|
"""
|
54
65
|
|
55
66
|
name: str | None = Field(
|
@@ -99,9 +110,12 @@ class ModelParams(SchemaModel):
|
|
99
110
|
def use_fields(self) -> dict[str, tuple[type, FieldInfo]]:
|
100
111
|
"""Get field definitions to use in new model.
|
101
112
|
|
113
|
+
Filters and combines fields from parameter_fields and field_models based on
|
114
|
+
the _use_keys set, preparing them for use in model creation.
|
115
|
+
|
102
116
|
Returns:
|
103
|
-
|
104
|
-
|
117
|
+
A dictionary mapping field names to tuples of (type, FieldInfo),
|
118
|
+
containing only the fields that should be included in the new model.
|
105
119
|
"""
|
106
120
|
params = {
|
107
121
|
k: v
|
@@ -233,11 +247,16 @@ class ModelParams(SchemaModel):
|
|
233
247
|
def validate_param_model(self) -> Self:
|
234
248
|
"""Validate complete model configuration.
|
235
249
|
|
236
|
-
|
237
|
-
|
250
|
+
Performs comprehensive validation and setup of the model parameters:
|
251
|
+
1. Updates parameter fields from base type if present
|
252
|
+
2. Merges field models into parameter fields
|
253
|
+
3. Manages field inclusion/exclusion via _use_keys
|
254
|
+
4. Sets up validators from field models
|
255
|
+
5. Applies field descriptions
|
256
|
+
6. Handles model name resolution
|
238
257
|
|
239
258
|
Returns:
|
240
|
-
|
259
|
+
The validated model instance with all configurations applied.
|
241
260
|
"""
|
242
261
|
if self.base_type is not None:
|
243
262
|
self.parameter_fields.update(copy(self.base_type.model_fields))
|
@@ -21,34 +21,33 @@ IndiceType: TypeAlias = str | list[str | int]
|
|
21
21
|
class Note(BaseModel):
|
22
22
|
"""Container for managing nested dictionary data structures.
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
Example:
|
31
|
-
```python
|
32
|
-
note = Note(
|
33
|
-
user={
|
34
|
-
"name": "John",
|
35
|
-
"settings": {
|
36
|
-
"theme": "dark"
|
37
|
-
}
|
38
|
-
}
|
39
|
-
)
|
40
|
-
|
41
|
-
# Access nested data
|
42
|
-
name = note.get(["user", "name"])
|
43
|
-
theme = note["user"]["settings"]["theme"]
|
44
|
-
|
45
|
-
# Update nested structure
|
46
|
-
note.update(["user", "settings"], {"language": "en"})
|
47
|
-
```
|
24
|
+
A flexible container that provides deep nested data access, dictionary-like
|
25
|
+
interface, flattening capabilities, and update operations for managing
|
26
|
+
complex nested data structures.
|
27
|
+
|
28
|
+
Args:
|
29
|
+
**kwargs: Key-value pairs for initial content.
|
48
30
|
|
49
31
|
Attributes:
|
50
|
-
content: Nested dictionary structure
|
51
|
-
model_config: Configuration allowing arbitrary types
|
32
|
+
content: Nested dictionary structure.
|
33
|
+
model_config: Configuration allowing arbitrary types.
|
34
|
+
|
35
|
+
Examples:
|
36
|
+
>>> note = Note(
|
37
|
+
... user={
|
38
|
+
... "name": "John",
|
39
|
+
... "settings": {
|
40
|
+
... "theme": "dark"
|
41
|
+
... }
|
42
|
+
... }
|
43
|
+
... )
|
44
|
+
>>>
|
45
|
+
>>> # Access nested data
|
46
|
+
>>> name = note.get(["user", "name"])
|
47
|
+
>>> theme = note["user"]["settings"]["theme"]
|
48
|
+
>>>
|
49
|
+
>>> # Update nested structure
|
50
|
+
>>> note.update(["user", "settings"], {"language": "en"})
|
52
51
|
"""
|
53
52
|
|
54
53
|
content: dict[str, Any] = Field(
|
@@ -65,7 +64,8 @@ class Note(BaseModel):
|
|
65
64
|
"""Initialize Note with dictionary data.
|
66
65
|
|
67
66
|
Args:
|
68
|
-
**kwargs: Key-value pairs
|
67
|
+
**kwargs: Key-value pairs that will form the initial nested
|
68
|
+
dictionary structure.
|
69
69
|
"""
|
70
70
|
super().__init__()
|
71
71
|
self.content = kwargs
|
@@ -103,15 +103,22 @@ class Note(BaseModel):
|
|
103
103
|
) -> Any:
|
104
104
|
"""Remove and return item from nested structure.
|
105
105
|
|
106
|
+
Removes and returns the value at the specified path in the nested
|
107
|
+
structure. If the path doesn't exist and no default is provided,
|
108
|
+
raises KeyError.
|
109
|
+
|
106
110
|
Args:
|
107
|
-
indices: Path to item
|
108
|
-
|
111
|
+
indices: Path to the item to remove, can be a string for top-level
|
112
|
+
keys or a list for nested access.
|
113
|
+
default: Value to return if the path is not found. If not provided
|
114
|
+
and path is not found, raises KeyError.
|
109
115
|
|
110
116
|
Returns:
|
111
|
-
|
117
|
+
The value that was removed, or the default value if provided and
|
118
|
+
path not found.
|
112
119
|
|
113
120
|
Raises:
|
114
|
-
KeyError: If path not found and no default
|
121
|
+
KeyError: If the path is not found and no default value is provided.
|
115
122
|
"""
|
116
123
|
indices = to_list(indices, flatten=True, dropna=True)
|
117
124
|
return npop(self.content, indices, default)
|
@@ -147,15 +154,21 @@ class Note(BaseModel):
|
|
147
154
|
) -> Any:
|
148
155
|
"""Get value from nested structure at specified indices.
|
149
156
|
|
157
|
+
Retrieves the value at the specified path in the nested structure.
|
158
|
+
If the path doesn't exist and no default is provided, raises KeyError.
|
159
|
+
|
150
160
|
Args:
|
151
|
-
indices: Path to value
|
152
|
-
|
161
|
+
indices: Path to the value, can be a string for top-level keys
|
162
|
+
or a list for nested access.
|
163
|
+
default: Value to return if the path is not found. If not provided
|
164
|
+
and path is not found, raises KeyError.
|
153
165
|
|
154
166
|
Returns:
|
155
|
-
|
167
|
+
The value at the specified path, or the default value if provided
|
168
|
+
and path not found.
|
156
169
|
|
157
170
|
Raises:
|
158
|
-
KeyError: If path not found and no default
|
171
|
+
KeyError: If the path is not found and no default value is provided.
|
159
172
|
"""
|
160
173
|
indices = to_list(indices, flatten=True, dropna=True)
|
161
174
|
return nget(self.content, indices, default)
|
@@ -179,12 +192,18 @@ class Note(BaseModel):
|
|
179
192
|
def values(self, /, flat: bool = False, **kwargs: Any) -> ValuesView:
|
180
193
|
"""Get values of the Note.
|
181
194
|
|
195
|
+
Returns either a view of top-level values or, if flat=True, a view
|
196
|
+
of all values in the flattened nested structure.
|
197
|
+
|
182
198
|
Args:
|
183
|
-
flat: If True,
|
184
|
-
|
199
|
+
flat: If True, returns values from all levels of the nested
|
200
|
+
structure. If False, returns only top-level values.
|
201
|
+
kwargs: Additional options for flattening behavior when flat=True.
|
202
|
+
Common options include coerce_keys and coerce_sequence.
|
185
203
|
|
186
204
|
Returns:
|
187
|
-
|
205
|
+
A ValuesView object containing either top-level values or all
|
206
|
+
values from the flattened structure if flat=True.
|
188
207
|
"""
|
189
208
|
if flat:
|
190
209
|
kwargs["coerce_keys"] = kwargs.get("coerce_keys", False)
|
@@ -219,12 +238,21 @@ class Note(BaseModel):
|
|
219
238
|
) -> None:
|
220
239
|
"""Update nested structure at specified indices.
|
221
240
|
|
241
|
+
Updates the value at the specified path in the nested structure.
|
242
|
+
The behavior depends on the existing value and the update value:
|
243
|
+
- If path doesn't exist: creates it with value (wrapped in list if scalar)
|
244
|
+
- If existing is list: extends with value if list, appends if scalar
|
245
|
+
- If existing is dict: updates with value if dict, raises error if not
|
246
|
+
|
222
247
|
Args:
|
223
|
-
indices:
|
224
|
-
|
248
|
+
indices: Path to the location to update, can be a string for
|
249
|
+
top-level keys or a list for nested access.
|
250
|
+
value: The new value to set. Must be compatible with existing
|
251
|
+
value type (dict for dict, any value for list).
|
225
252
|
|
226
253
|
Raises:
|
227
|
-
ValueError: If trying to update
|
254
|
+
ValueError: If trying to update a dictionary with a non-dictionary
|
255
|
+
value.
|
228
256
|
"""
|
229
257
|
existing = None
|
230
258
|
if not indices:
|
@@ -269,19 +297,26 @@ class Note(BaseModel):
|
|
269
297
|
def __contains__(self, indices: IndiceType) -> bool:
|
270
298
|
"""Check if indices exist in content.
|
271
299
|
|
300
|
+
Implements the 'in' operator for checking path existence in the nested
|
301
|
+
structure.
|
302
|
+
|
272
303
|
Args:
|
273
|
-
indices: Path to check
|
304
|
+
indices: Path to check, can be a string for top-level keys or a
|
305
|
+
list for nested access.
|
274
306
|
|
275
307
|
Returns:
|
276
|
-
True if path exists, False otherwise
|
308
|
+
True if the path exists in the nested structure, False otherwise.
|
277
309
|
"""
|
278
310
|
return self.content.get(indices, UNDEFINED) is not UNDEFINED
|
279
311
|
|
280
312
|
def __len__(self) -> int:
|
281
313
|
"""Get length of content.
|
282
314
|
|
315
|
+
Implements len() function to return the number of top-level keys in
|
316
|
+
the nested structure.
|
317
|
+
|
283
318
|
Returns:
|
284
|
-
|
319
|
+
The number of top-level keys in the content dictionary.
|
285
320
|
"""
|
286
321
|
return len(self.content)
|
287
322
|
|
@@ -305,8 +340,12 @@ class Note(BaseModel):
|
|
305
340
|
def __str__(self) -> str:
|
306
341
|
"""Get string representation of content.
|
307
342
|
|
343
|
+
Implements str() function to provide a simple string representation
|
344
|
+
of the Note's content. Uses the standard dictionary string format.
|
345
|
+
|
308
346
|
Returns:
|
309
|
-
|
347
|
+
A string representation of the content dictionary, showing its
|
348
|
+
current state.
|
310
349
|
"""
|
311
350
|
return str(self.content)
|
312
351
|
|
@@ -4,7 +4,13 @@
|
|
4
4
|
|
5
5
|
from typing import Any, TypeVar
|
6
6
|
|
7
|
-
from pydantic import
|
7
|
+
from pydantic import (
|
8
|
+
BaseModel,
|
9
|
+
ConfigDict,
|
10
|
+
Field,
|
11
|
+
field_validator,
|
12
|
+
model_validator,
|
13
|
+
)
|
8
14
|
from pydantic.fields import FieldInfo
|
9
15
|
from pydantic_core import PydanticUndefined
|
10
16
|
from typing_extensions import Self, override
|
@@ -12,6 +18,7 @@ from typing_extensions import Self, override
|
|
12
18
|
from lionagi.utils import UNDEFINED, HashableModel, is_same_dtype
|
13
19
|
|
14
20
|
from .field_model import FieldModel
|
21
|
+
from .model_params import ModelParams
|
15
22
|
|
16
23
|
FieldName = TypeVar("FieldName", bound=str)
|
17
24
|
|
@@ -22,16 +29,20 @@ __all__ = ("OperableModel",)
|
|
22
29
|
class OperableModel(HashableModel):
|
23
30
|
"""Base model supporting dynamic field management and operations.
|
24
31
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
32
|
+
A Pydantic model extension that enables runtime field modifications while
|
33
|
+
maintaining type safety and validation. Supports dynamic field addition,
|
34
|
+
updates, and removal, with full serialization capabilities.
|
35
|
+
|
36
|
+
Args:
|
37
|
+
**kwargs: Key-value pairs for initial field values.
|
29
38
|
|
30
39
|
Attributes:
|
31
|
-
extra_fields:
|
32
|
-
|
40
|
+
extra_fields: Dictionary mapping field names to their FieldInfo
|
41
|
+
definitions for dynamically added fields.
|
42
|
+
extra_field_models: Dictionary mapping field names to their FieldModel
|
43
|
+
instances for fields with additional configuration.
|
33
44
|
|
34
|
-
|
45
|
+
Examples:
|
35
46
|
>>> class UserModel(OperableModel):
|
36
47
|
... name: str = "default"
|
37
48
|
...
|
@@ -199,6 +210,15 @@ class OperableModel(HashableModel):
|
|
199
210
|
super().__setattr__(field_name, value)
|
200
211
|
|
201
212
|
def __delattr__(self, field_name):
|
213
|
+
"""Delete an attribute from the model.
|
214
|
+
|
215
|
+
For extra fields, attempts to reset to default value if one exists,
|
216
|
+
otherwise removes the field completely. For regular fields, delegates
|
217
|
+
to parent class deletion behavior.
|
218
|
+
|
219
|
+
Args:
|
220
|
+
field_name: Name of the field to delete.
|
221
|
+
"""
|
202
222
|
if field_name in self.extra_fields:
|
203
223
|
if self.extra_fields[field_name].default not in [
|
204
224
|
UNDEFINED,
|
@@ -476,3 +496,93 @@ class OperableModel(HashableModel):
|
|
476
496
|
raise AttributeError(
|
477
497
|
f"field {field_name} has no attribute {attr}",
|
478
498
|
)
|
499
|
+
|
500
|
+
def new_model(
|
501
|
+
self,
|
502
|
+
name: str | None = None,
|
503
|
+
use_fields: set[str] | None = None, # default is all_fields
|
504
|
+
base_type: type[BaseModel] | None = None, # default is BaseModel
|
505
|
+
exclude_fields: list = None,
|
506
|
+
inherit_base: bool = True,
|
507
|
+
config_dict: ConfigDict | dict | None = None,
|
508
|
+
doc: str | None = None,
|
509
|
+
frozen: bool = False,
|
510
|
+
update_forward_refs: bool = True,
|
511
|
+
) -> type[BaseModel]:
|
512
|
+
"""Create a new Pydantic model type from the current model's fields.
|
513
|
+
|
514
|
+
Generates a new model class using the specified fields and configuration.
|
515
|
+
The new model can inherit from a base type and include a subset of fields
|
516
|
+
from the current model.
|
517
|
+
|
518
|
+
Args:
|
519
|
+
name: Name for the new model class. If None, a default name will be
|
520
|
+
generated.
|
521
|
+
use_fields: Set of field names to include in the new model. If None,
|
522
|
+
includes all fields.
|
523
|
+
base_type: Base model class to inherit from. Defaults to BaseModel
|
524
|
+
if None.
|
525
|
+
exclude_fields: List of field names to exclude from the new model.
|
526
|
+
inherit_base: Whether to inherit fields from the base_type.
|
527
|
+
Defaults to True.
|
528
|
+
config_dict: Pydantic model configuration for the new model.
|
529
|
+
doc: Docstring for the new model class.
|
530
|
+
frozen: If True, creates an immutable model where fields cannot be
|
531
|
+
modified after creation. Defaults to False.
|
532
|
+
update_forward_refs: Whether to attempt updating forward references
|
533
|
+
in the new model. Defaults to True.
|
534
|
+
|
535
|
+
Returns:
|
536
|
+
A new Pydantic model class with the specified configuration.
|
537
|
+
|
538
|
+
Raises:
|
539
|
+
ValueError: If use_fields contains invalid field names.
|
540
|
+
|
541
|
+
Examples:
|
542
|
+
>>> model = OperableModel()
|
543
|
+
>>> model.add_field("name", value="test", annotation=str)
|
544
|
+
>>> model.add_field("age", value=25, annotation=int)
|
545
|
+
>>> NewModel = model.new_model(
|
546
|
+
... name="UserModel",
|
547
|
+
... use_fields={"name", "age"},
|
548
|
+
... frozen=True
|
549
|
+
... )
|
550
|
+
>>> user = NewModel(name="Alice", age=30)
|
551
|
+
"""
|
552
|
+
|
553
|
+
use_fields = (
|
554
|
+
set(use_fields) if use_fields else set(self.all_fields.keys())
|
555
|
+
)
|
556
|
+
if not use_fields.issubset(self.all_fields.keys()):
|
557
|
+
raise ValueError("Invalid field names in use_fields")
|
558
|
+
|
559
|
+
field_models = []
|
560
|
+
parameter_fields = {}
|
561
|
+
|
562
|
+
for field_name in use_fields:
|
563
|
+
if field_name in self.extra_field_models:
|
564
|
+
field_models.append(self.extra_field_models[field_name])
|
565
|
+
elif field_name in self.all_fields:
|
566
|
+
parameter_fields[field_name] = self.all_fields[field_name]
|
567
|
+
|
568
|
+
model_params = ModelParams(
|
569
|
+
name=name,
|
570
|
+
parameter_fields=parameter_fields,
|
571
|
+
base_type=base_type,
|
572
|
+
field_models=field_models,
|
573
|
+
exclude_fields=exclude_fields,
|
574
|
+
inherit_base=inherit_base,
|
575
|
+
config_dict=config_dict,
|
576
|
+
doc=doc,
|
577
|
+
frozen=frozen,
|
578
|
+
)
|
579
|
+
model_cls = model_params.create_new_model()
|
580
|
+
|
581
|
+
# Update forward references if requested
|
582
|
+
if update_forward_refs:
|
583
|
+
try:
|
584
|
+
model_cls.model_rebuild()
|
585
|
+
except Exception:
|
586
|
+
pass # Ignore rebuild errors for forward refs that can't be resolved yet
|
587
|
+
|
588
|
+
return model_cls
|
lionagi/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.8.
|
1
|
+
__version__ = "0.8.2"
|
@@ -4,7 +4,7 @@ lionagi/_errors.py,sha256=wNKdnVQvE_CHEstK7htrrj334RA_vbGcIds-3pUiRkc,455
|
|
4
4
|
lionagi/_types.py,sha256=9g7iytvSj3UjZxD-jL06_fxuNfgZyWT3Qnp0XYp1wQU,63
|
5
5
|
lionagi/settings.py,sha256=k9zRJXv57TveyfHO3Vr9VGiKrSwlRUUVKt5zf6v9RU4,1627
|
6
6
|
lionagi/utils.py,sha256=QbF4E1PG-BaRcEVH3kJIYCJVNq-oRNoTxjda5k8NYW4,73177
|
7
|
-
lionagi/version.py,sha256=
|
7
|
+
lionagi/version.py,sha256=B7GiO0rd49YwtLYjvPg4lmCZEDlMTonslQKdSImaMJk,22
|
8
8
|
lionagi/libs/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
|
9
9
|
lionagi/libs/parse.py,sha256=tpEbmIRGuHhLCJlUlm6fjmqm_Z6XJLAXGNFHNuk422I,1011
|
10
10
|
lionagi/libs/file/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
|
@@ -100,10 +100,10 @@ lionagi/operatives/instruct/node.py,sha256=0g7g2jsLO8L8VlD-L1mFmjcFTwWy39moWCDtL
|
|
100
100
|
lionagi/operatives/instruct/prompts.py,sha256=RG8rB7Y0J17aTHTb9kTTHxltVjgRAuC4vjM9B1_hTuQ,1747
|
101
101
|
lionagi/operatives/instruct/reason.py,sha256=mdCMBO3YSWYncXU_B1bYuZqpkj4pfUMsxsz9vXXAMw4,2341
|
102
102
|
lionagi/operatives/models/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
|
103
|
-
lionagi/operatives/models/field_model.py,sha256=
|
104
|
-
lionagi/operatives/models/model_params.py,sha256=
|
105
|
-
lionagi/operatives/models/note.py,sha256=
|
106
|
-
lionagi/operatives/models/operable_model.py,sha256=
|
103
|
+
lionagi/operatives/models/field_model.py,sha256=jugM0K3b-iE--OcKU6i2CvpByGfQv--AQfNuSeudBuU,6518
|
104
|
+
lionagi/operatives/models/model_params.py,sha256=41CFRuunSPXZEiMAx12zENfRUI9i0YI4rRCcv5pNF0o,10362
|
105
|
+
lionagi/operatives/models/note.py,sha256=7OjtoSVxqGlzPnnscKCbi9bMz8WGJh7zQ9o8MEPv3kQ,12202
|
106
|
+
lionagi/operatives/models/operable_model.py,sha256=7bF4XYvYhcMYT_mh862K-xr8izkhmPfod-aioWuMDvg,19728
|
107
107
|
lionagi/operatives/models/schema_model.py,sha256=-BeCwW_1Rle--w-f7MajbOYH7t_8SPWw0_qK0fpTsRg,666
|
108
108
|
lionagi/operatives/strategies/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
|
109
109
|
lionagi/operatives/strategies/base.py,sha256=cfZXUZYPypW-hFZJj7HDtTPc-x99XB6dO_S5os1srTk,1820
|
@@ -189,7 +189,7 @@ lionagi/service/providers/perplexity_/chat_completions.py,sha256=SsDbrtXwQsR4Yu2
|
|
189
189
|
lionagi/session/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
|
190
190
|
lionagi/session/branch.py,sha256=JvErd9YUuGdWyLj37rtKOteSqV0ltn9lg0R2G8GO40c,62539
|
191
191
|
lionagi/session/session.py,sha256=po6C7PnM0iu_ISHUo4PBzzQ61HFOgcsAUfPoO--eLak,8987
|
192
|
-
lionagi-0.8.
|
193
|
-
lionagi-0.8.
|
194
|
-
lionagi-0.8.
|
195
|
-
lionagi-0.8.
|
192
|
+
lionagi-0.8.2.dist-info/METADATA,sha256=lJ_wNrsDsRFOVYHqCc9GbFWe5bFyusOF7-nZW_cMIL4,22819
|
193
|
+
lionagi-0.8.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
194
|
+
lionagi-0.8.2.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
|
195
|
+
lionagi-0.8.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|