kiln_ai.datamodel.strict_mode
Strict mode is a feature that enables extra validations that we want to enforce in Kiln App, ensuring everything follows the ideal schema.
It's off by default when used through the library. Enable it by calling set_strict_mode(True)
.
1""" 2Strict mode is a feature that enables extra validations that we want to enforce in Kiln App, ensuring everything follows the ideal schema. 3 4It's off by default when used through the library. Enable it by calling `set_strict_mode(True)`. 5""" 6 7# We want to be hard on ourselves for data completeness generated by the Kiln App, but don't want to make it hard for users to use the datamodel/library. 8# Strict mode enables extra validations that we want to enforce in Kiln App (and any other client that wants best practices), but not in the library (unless they opt in) 9_strict_mode: bool = False 10 11 12def strict_mode() -> bool: 13 """ 14 Get the current strict mode setting. 15 """ 16 return _strict_mode 17 18 19def set_strict_mode(value: bool) -> None: 20 """ 21 Set the strict mode setting. 22 """ 23 global _strict_mode 24 _strict_mode = value
def
strict_mode() -> bool:
13def strict_mode() -> bool: 14 """ 15 Get the current strict mode setting. 16 """ 17 return _strict_mode
Get the current strict mode setting.
def
set_strict_mode(value: bool) -> None:
20def set_strict_mode(value: bool) -> None: 21 """ 22 Set the strict mode setting. 23 """ 24 global _strict_mode 25 _strict_mode = value
Set the strict mode setting.