v0 of user rolled AI
This commit is contained in:
parent
d9f12ec0de
commit
37b5ffd674
8 changed files with 90 additions and 21 deletions
|
|
@ -5,7 +5,8 @@ class BaseModel(pydantic.BaseModel):
|
|||
def __init__(self, **data):
|
||||
for key, value in data.items():
|
||||
if isinstance(value, dict):
|
||||
data[key] = self.parse_obj(value)
|
||||
if 'type' in value:
|
||||
data[key] = TypedModel.parse_obj(value)
|
||||
super().__init__(**data)
|
||||
|
||||
# Adapted from https://github.com/pydantic/pydantic/discussions/3091
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue