SchemaUtil class
This class, SchemaUtil, is a utility class that provides a static method for creating an object instance with attributes set from a dictionary.
from openfabric_pysdk.utility import SchemaUtil
def execute(request: InputClass, ray: Ray, state: State) -> OutputClass:
# App logic
...
output = request_after_processing
return SchemaUtil.create(OutputClass(), dict(user_output=output))
create(instance: Any, data: Dict[Any, Any])
Parameter | Description | Schema |
---|---|---|
instance | An instance of the target class for which attributes need to be set. | Any |
data | A dictionary containing key-value pairs, where keys represent attribute names and values represent attribute values. | Dict[Any, Any] |