darcyai.config
Config Objects
class Config()
Class to hold the configuration for the Perceptor.
Arguments
- name (
str): The name of the config. - label (
str): The label of the config. - config_type (
str): The type of the config. Valid types are:- int
- float
- bool
- str
- rgb
- default_value (
Any): The default value of the config. - description (
str): The description of the config.
is_valid
def is_valid(value: Any) -> bool
Checks if the value is valid for the config.
Arguments
- value (
Any): The value to check.
Returns
bool: True if the value is valid, False otherwise.
cast
def cast(value: Any) -> Any
Casts the value to the type of the config.
Arguments
- value (
Any): The value to cast.
Returns
Any: The casted value.