wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union, cast
      2
      3import attr
      4
      5from ..models.explainability_create_request_json_body_reference_config import \
      6    ExplainabilityCreateRequestJsonBodyReferenceConfig
      7from ..models.explainability_create_request_json_body_window_config import \
      8    ExplainabilityCreateRequestJsonBodyWindowConfig
      9from ..types import UNSET, Unset
     10
     11T = TypeVar("T", bound="ExplainabilityCreateRequestJsonBody")
     12
     13@attr.s(auto_attribs=True)
     14class ExplainabilityCreateRequestJsonBody:
     15    """ Create a request to be analyzed using a previously created config
     16
     17    Attributes:
     18        workspace_id (int):  The users workspace. Must match the workspace of the request and pipelines.
     19        explainability_config_id (str):  The config to use for this request
     20        use_adhoc_data (bool):  Specifies if adhoc data should be used. Included because adhoc data is stored in minio.
     21        id (Union[Unset, None, str]):
     22        reference_config (Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig]):  Specifies if start,
     23            end and num samples for the reference data.
     24        window_config (Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig]):  Specifies if start, end
     25            and num samples for the a window of data.
     26        adhoc_data (Union[Unset, None, List[List[float]]]):  User submitted adhoc data.
     27    """
     28
     29    workspace_id: int
     30    explainability_config_id: str
     31    use_adhoc_data: bool
     32    id: Union[Unset, None, str] = UNSET
     33    reference_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig] = UNSET
     34    window_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig] = UNSET
     35    adhoc_data: Union[Unset, None, List[List[float]]] = UNSET
     36    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     37
     38
     39    def to_dict(self) -> Dict[str, Any]:
     40        workspace_id = self.workspace_id
     41        explainability_config_id = self.explainability_config_id
     42        use_adhoc_data = self.use_adhoc_data
     43        id = self.id
     44        reference_config: Union[Unset, None, Dict[str, Any]] = UNSET
     45        if not isinstance(self.reference_config, Unset):
     46            reference_config = self.reference_config.to_dict() if self.reference_config else None
     47
     48        window_config: Union[Unset, None, Dict[str, Any]] = UNSET
     49        if not isinstance(self.window_config, Unset):
     50            window_config = self.window_config.to_dict() if self.window_config else None
     51
     52        adhoc_data: Union[Unset, None, List[List[float]]] = UNSET
     53        if not isinstance(self.adhoc_data, Unset):
     54            if self.adhoc_data is None:
     55                adhoc_data = None
     56            else:
     57                adhoc_data = []
     58                for adhoc_data_item_data in self.adhoc_data:
     59                    adhoc_data_item = adhoc_data_item_data
     60
     61
     62
     63
     64                    adhoc_data.append(adhoc_data_item)
     65
     66
     67
     68
     69
     70        field_dict: Dict[str, Any] = {}
     71        field_dict.update(self.additional_properties)
     72        field_dict.update({
     73            "workspace_id": workspace_id,
     74            "explainability_config_id": explainability_config_id,
     75            "use_adhoc_data": use_adhoc_data,
     76        })
     77        if id is not UNSET:
     78            field_dict["id"] = id
     79        if reference_config is not UNSET:
     80            field_dict["reference_config"] = reference_config
     81        if window_config is not UNSET:
     82            field_dict["window_config"] = window_config
     83        if adhoc_data is not UNSET:
     84            field_dict["adhoc_data"] = adhoc_data
     85
     86        return field_dict
     87
     88
     89
     90    @classmethod
     91    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     92        d = src_dict.copy()
     93        workspace_id = d.pop("workspace_id")
     94
     95        explainability_config_id = d.pop("explainability_config_id")
     96
     97        use_adhoc_data = d.pop("use_adhoc_data")
     98
     99        id = d.pop("id", UNSET)
    100
    101        _reference_config = d.pop("reference_config", UNSET)
    102        reference_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig]
    103        if _reference_config is None:
    104            reference_config = None
    105        elif isinstance(_reference_config,  Unset):
    106            reference_config = UNSET
    107        else:
    108            reference_config = ExplainabilityCreateRequestJsonBodyReferenceConfig.from_dict(_reference_config)
    109
    110
    111
    112
    113        _window_config = d.pop("window_config", UNSET)
    114        window_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig]
    115        if _window_config is None:
    116            window_config = None
    117        elif isinstance(_window_config,  Unset):
    118            window_config = UNSET
    119        else:
    120            window_config = ExplainabilityCreateRequestJsonBodyWindowConfig.from_dict(_window_config)
    121
    122
    123
    124
    125        adhoc_data = []
    126        _adhoc_data = d.pop("adhoc_data", UNSET)
    127        for adhoc_data_item_data in (_adhoc_data or []):
    128            adhoc_data_item = cast(List[float], adhoc_data_item_data)
    129
    130            adhoc_data.append(adhoc_data_item)
    131
    132
    133        explainability_create_request_json_body = cls(
    134            workspace_id=workspace_id,
    135            explainability_config_id=explainability_config_id,
    136            use_adhoc_data=use_adhoc_data,
    137            id=id,
    138            reference_config=reference_config,
    139            window_config=window_config,
    140            adhoc_data=adhoc_data,
    141        )
    142
    143        explainability_create_request_json_body.additional_properties = d
    144        return explainability_create_request_json_body
    145
    146    @property
    147    def additional_keys(self) -> List[str]:
    148        return list(self.additional_properties.keys())
    149
    150    def __getitem__(self, key: str) -> Any:
    151        return self.additional_properties[key]
    152
    153    def __setitem__(self, key: str, value: Any) -> None:
    154        self.additional_properties[key] = value
    155
    156    def __delitem__(self, key: str) -> None:
    157        del self.additional_properties[key]
    158
    159    def __contains__(self, key: str) -> bool:
    160        return key in self.additional_properties

@attr.s(auto_attribs=True)
class ExplainabilityCreateRequestJsonBody: View Source

     14@attr.s(auto_attribs=True)
     15class ExplainabilityCreateRequestJsonBody:
     16    """ Create a request to be analyzed using a previously created config
     17
     18    Attributes:
     19        workspace_id (int):  The users workspace. Must match the workspace of the request and pipelines.
     20        explainability_config_id (str):  The config to use for this request
     21        use_adhoc_data (bool):  Specifies if adhoc data should be used. Included because adhoc data is stored in minio.
     22        id (Union[Unset, None, str]):
     23        reference_config (Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig]):  Specifies if start,
     24            end and num samples for the reference data.
     25        window_config (Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig]):  Specifies if start, end
     26            and num samples for the a window of data.
     27        adhoc_data (Union[Unset, None, List[List[float]]]):  User submitted adhoc data.
     28    """
     29
     30    workspace_id: int
     31    explainability_config_id: str
     32    use_adhoc_data: bool
     33    id: Union[Unset, None, str] = UNSET
     34    reference_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig] = UNSET
     35    window_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig] = UNSET
     36    adhoc_data: Union[Unset, None, List[List[float]]] = UNSET
     37    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     38
     39
     40    def to_dict(self) -> Dict[str, Any]:
     41        workspace_id = self.workspace_id
     42        explainability_config_id = self.explainability_config_id
     43        use_adhoc_data = self.use_adhoc_data
     44        id = self.id
     45        reference_config: Union[Unset, None, Dict[str, Any]] = UNSET
     46        if not isinstance(self.reference_config, Unset):
     47            reference_config = self.reference_config.to_dict() if self.reference_config else None
     48
     49        window_config: Union[Unset, None, Dict[str, Any]] = UNSET
     50        if not isinstance(self.window_config, Unset):
     51            window_config = self.window_config.to_dict() if self.window_config else None
     52
     53        adhoc_data: Union[Unset, None, List[List[float]]] = UNSET
     54        if not isinstance(self.adhoc_data, Unset):
     55            if self.adhoc_data is None:
     56                adhoc_data = None
     57            else:
     58                adhoc_data = []
     59                for adhoc_data_item_data in self.adhoc_data:
     60                    adhoc_data_item = adhoc_data_item_data
     61
     62
     63
     64
     65                    adhoc_data.append(adhoc_data_item)
     66
     67
     68
     69
     70
     71        field_dict: Dict[str, Any] = {}
     72        field_dict.update(self.additional_properties)
     73        field_dict.update({
     74            "workspace_id": workspace_id,
     75            "explainability_config_id": explainability_config_id,
     76            "use_adhoc_data": use_adhoc_data,
     77        })
     78        if id is not UNSET:
     79            field_dict["id"] = id
     80        if reference_config is not UNSET:
     81            field_dict["reference_config"] = reference_config
     82        if window_config is not UNSET:
     83            field_dict["window_config"] = window_config
     84        if adhoc_data is not UNSET:
     85            field_dict["adhoc_data"] = adhoc_data
     86
     87        return field_dict
     88
     89
     90
     91    @classmethod
     92    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     93        d = src_dict.copy()
     94        workspace_id = d.pop("workspace_id")
     95
     96        explainability_config_id = d.pop("explainability_config_id")
     97
     98        use_adhoc_data = d.pop("use_adhoc_data")
     99
    100        id = d.pop("id", UNSET)
    101
    102        _reference_config = d.pop("reference_config", UNSET)
    103        reference_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig]
    104        if _reference_config is None:
    105            reference_config = None
    106        elif isinstance(_reference_config,  Unset):
    107            reference_config = UNSET
    108        else:
    109            reference_config = ExplainabilityCreateRequestJsonBodyReferenceConfig.from_dict(_reference_config)
    110
    111
    112
    113
    114        _window_config = d.pop("window_config", UNSET)
    115        window_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig]
    116        if _window_config is None:
    117            window_config = None
    118        elif isinstance(_window_config,  Unset):
    119            window_config = UNSET
    120        else:
    121            window_config = ExplainabilityCreateRequestJsonBodyWindowConfig.from_dict(_window_config)
    122
    123
    124
    125
    126        adhoc_data = []
    127        _adhoc_data = d.pop("adhoc_data", UNSET)
    128        for adhoc_data_item_data in (_adhoc_data or []):
    129            adhoc_data_item = cast(List[float], adhoc_data_item_data)
    130
    131            adhoc_data.append(adhoc_data_item)
    132
    133
    134        explainability_create_request_json_body = cls(
    135            workspace_id=workspace_id,
    136            explainability_config_id=explainability_config_id,
    137            use_adhoc_data=use_adhoc_data,
    138            id=id,
    139            reference_config=reference_config,
    140            window_config=window_config,
    141            adhoc_data=adhoc_data,
    142        )
    143
    144        explainability_create_request_json_body.additional_properties = d
    145        return explainability_create_request_json_body
    146
    147    @property
    148    def additional_keys(self) -> List[str]:
    149        return list(self.additional_properties.keys())
    150
    151    def __getitem__(self, key: str) -> Any:
    152        return self.additional_properties[key]
    153
    154    def __setitem__(self, key: str, value: Any) -> None:
    155        self.additional_properties[key] = value
    156
    157    def __delitem__(self, key: str) -> None:
    158        del self.additional_properties[key]
    159
    160    def __contains__(self, key: str) -> bool:
    161        return key in self.additional_properties

Create a request to be analyzed using a previously created config

Attributes: workspace_id (int): The users workspace. Must match the workspace of the request and pipelines. explainability_config_id (str): The config to use for this request use_adhoc_data (bool): Specifies if adhoc data should be used. Included because adhoc data is stored in minio. id (Union[Unset, None, str]): reference_config (Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig]): Specifies if start, end and num samples for the reference data. window_config (Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig]): Specifies if start, end and num samples for the a window of data. adhoc_data (Union[Unset, None, List[List[float]]]): User submitted adhoc data.

ExplainabilityCreateRequestJsonBody( workspace_id: int, explainability_config_id: str, use_adhoc_data: bool, id: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, reference_config: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body_reference_config.ExplainabilityCreateRequestJsonBodyReferenceConfig] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, window_config: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body_window_config.ExplainabilityCreateRequestJsonBodyWindowConfig] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, adhoc_data: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[List[float]]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

     2def __init__(self, workspace_id, explainability_config_id, use_adhoc_data, id=attr_dict['id'].default, reference_config=attr_dict['reference_config'].default, window_config=attr_dict['window_config'].default, adhoc_data=attr_dict['adhoc_data'].default):
     3    self.workspace_id = workspace_id
     4    self.explainability_config_id = explainability_config_id
     5    self.use_adhoc_data = use_adhoc_data
     6    self.id = id
     7    self.reference_config = reference_config
     8    self.window_config = window_config
     9    self.adhoc_data = adhoc_data
    10    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class ExplainabilityCreateRequestJsonBody.

def to_dict(self) -> Dict[str, Any]: View Source

    40    def to_dict(self) -> Dict[str, Any]:
    41        workspace_id = self.workspace_id
    42        explainability_config_id = self.explainability_config_id
    43        use_adhoc_data = self.use_adhoc_data
    44        id = self.id
    45        reference_config: Union[Unset, None, Dict[str, Any]] = UNSET
    46        if not isinstance(self.reference_config, Unset):
    47            reference_config = self.reference_config.to_dict() if self.reference_config else None
    48
    49        window_config: Union[Unset, None, Dict[str, Any]] = UNSET
    50        if not isinstance(self.window_config, Unset):
    51            window_config = self.window_config.to_dict() if self.window_config else None
    52
    53        adhoc_data: Union[Unset, None, List[List[float]]] = UNSET
    54        if not isinstance(self.adhoc_data, Unset):
    55            if self.adhoc_data is None:
    56                adhoc_data = None
    57            else:
    58                adhoc_data = []
    59                for adhoc_data_item_data in self.adhoc_data:
    60                    adhoc_data_item = adhoc_data_item_data
    61
    62
    63
    64
    65                    adhoc_data.append(adhoc_data_item)
    66
    67
    68
    69
    70
    71        field_dict: Dict[str, Any] = {}
    72        field_dict.update(self.additional_properties)
    73        field_dict.update({
    74            "workspace_id": workspace_id,
    75            "explainability_config_id": explainability_config_id,
    76            "use_adhoc_data": use_adhoc_data,
    77        })
    78        if id is not UNSET:
    79            field_dict["id"] = id
    80        if reference_config is not UNSET:
    81            field_dict["reference_config"] = reference_config
    82        if window_config is not UNSET:
    83            field_dict["window_config"] = window_config
    84        if adhoc_data is not UNSET:
    85            field_dict["adhoc_data"] = adhoc_data
    86
    87        return field_dict

@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T: View Source

     91    @classmethod
     92    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     93        d = src_dict.copy()
     94        workspace_id = d.pop("workspace_id")
     95
     96        explainability_config_id = d.pop("explainability_config_id")
     97
     98        use_adhoc_data = d.pop("use_adhoc_data")
     99
    100        id = d.pop("id", UNSET)
    101
    102        _reference_config = d.pop("reference_config", UNSET)
    103        reference_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyReferenceConfig]
    104        if _reference_config is None:
    105            reference_config = None
    106        elif isinstance(_reference_config,  Unset):
    107            reference_config = UNSET
    108        else:
    109            reference_config = ExplainabilityCreateRequestJsonBodyReferenceConfig.from_dict(_reference_config)
    110
    111
    112
    113
    114        _window_config = d.pop("window_config", UNSET)
    115        window_config: Union[Unset, None, ExplainabilityCreateRequestJsonBodyWindowConfig]
    116        if _window_config is None:
    117            window_config = None
    118        elif isinstance(_window_config,  Unset):
    119            window_config = UNSET
    120        else:
    121            window_config = ExplainabilityCreateRequestJsonBodyWindowConfig.from_dict(_window_config)
    122
    123
    124
    125
    126        adhoc_data = []
    127        _adhoc_data = d.pop("adhoc_data", UNSET)
    128        for adhoc_data_item_data in (_adhoc_data or []):
    129            adhoc_data_item = cast(List[float], adhoc_data_item_data)
    130
    131            adhoc_data.append(adhoc_data_item)
    132
    133
    134        explainability_create_request_json_body = cls(
    135            workspace_id=workspace_id,
    136            explainability_config_id=explainability_config_id,
    137            use_adhoc_data=use_adhoc_data,
    138            id=id,
    139            reference_config=reference_config,
    140            window_config=window_config,
    141            adhoc_data=adhoc_data,
    142        )
    143
    144        explainability_create_request_json_body.additional_properties = d
    145        return explainability_create_request_json_body

additional_keys: List[str]