Auto-update: Thu Aug 8 17:15:05 PDT 2024
This commit is contained in:
parent
304a45c4c1
commit
75ef6577d1
1 changed files with 4 additions and 2 deletions
|
@ -363,7 +363,9 @@ class APIConfig(BaseModel):
|
||||||
raise ValueError(f"Invalid value for {key}: {value}. Must be 'on', 'off', True, or False.")
|
raise ValueError(f"Invalid value for {key}: {value}. Must be 'on', 'off', True, or False.")
|
||||||
|
|
||||||
DynamicConfig = create_model(model_name, **fields)
|
DynamicConfig = create_model(model_name, **fields)
|
||||||
return DynamicConfig(**data)
|
instance_data = {k: (v.lower() == 'on' if isinstance(v, str) else v) for k, v in data.items()}
|
||||||
|
return DynamicConfig(**instance_data)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _resolve_path(cls, path: Union[str, Path], default_dir: str) -> Path:
|
def _resolve_path(cls, path: Union[str, Path], default_dir: str) -> Path:
|
||||||
|
|
Loading…
Reference in a new issue