wallaroo.wallaroo_ml_ops_api_client.api.explainability.explainability_create_config API documentation

# wallaroo.wallaroo_ml_ops_api_client.api.explainability.explainability_create_config

View Source

      1from typing import Any, Dict, Optional, Union
      2
      3import httpx
      4
      5from ...client import Client
      6from ...models.explainability_create_config_json_body import \
      7    ExplainabilityCreateConfigJsonBody
      8from ...models.explainability_create_config_response_200 import \
      9    ExplainabilityCreateConfigResponse200
     10from ...models.explainability_create_config_response_400 import \
     11    ExplainabilityCreateConfigResponse400
     12from ...models.explainability_create_config_response_401 import \
     13    ExplainabilityCreateConfigResponse401
     14from ...models.explainability_create_config_response_500 import \
     15    ExplainabilityCreateConfigResponse500
     16from ...types import Response
     17
     18
     19def _get_kwargs(
     20    *,
     21    client: Client,
     22    json_body: ExplainabilityCreateConfigJsonBody,
     23
     24) -> Dict[str, Any]:
     25    url = "{}/v1/api/explainability/create_config".format(
     26        client.base_url)
     27
     28    headers: Dict[str, str] = client.get_headers()
     29    cookies: Dict[str, Any] = client.get_cookies()
     30
     31
     32
     33
     34
     35
     36
     37    json_json_body = json_body.to_dict()
     38
     39
     40
     41
     42
     43    return {
     44	    "method": "post",
     45        "url": url,
     46        "headers": headers,
     47        "cookies": cookies,
     48        "timeout": client.get_timeout(),
     49        "json": json_json_body,
     50    }
     51
     52
     53def _parse_response(*, response: httpx.Response) -> Optional[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
     54    if response.status_code == 500:
     55        response_500 = ExplainabilityCreateConfigResponse500.from_dict(response.json())
     56
     57
     58
     59        return response_500
     60    if response.status_code == 400:
     61        response_400 = ExplainabilityCreateConfigResponse400.from_dict(response.json())
     62
     63
     64
     65        return response_400
     66    if response.status_code == 401:
     67        response_401 = ExplainabilityCreateConfigResponse401.from_dict(response.json())
     68
     69
     70
     71        return response_401
     72    if response.status_code == 200:
     73        _response_200 = response.json()
     74        response_200: Optional[ExplainabilityCreateConfigResponse200]
     75        if _response_200 is None:
     76            response_200 = None
     77        else:
     78            response_200 = ExplainabilityCreateConfigResponse200.from_dict(_response_200)
     79
     80
     81
     82        return response_200
     83    return None
     84
     85
     86def _build_response(*, response: httpx.Response) -> Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
     87    return Response(
     88        status_code=response.status_code,
     89        content=response.content,
     90        headers=response.headers,
     91        parsed=_parse_response(response=response),
     92    )
     93
     94
     95def sync_detailed(
     96    *,
     97    client: Client,
     98    json_body: ExplainabilityCreateConfigJsonBody,
     99
    100) -> Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    101    """Create an explainability config
    102
    103     Creates an explainability config that can be used to create and compare analysis.
    104
    105    Args:
    106        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    107            explainability requests
    108
    109    Returns:
    110        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    111    """
    112
    113
    114    kwargs = _get_kwargs(
    115        client=client,
    116json_body=json_body,
    117
    118    )
    119
    120    response = httpx.request(
    121        verify=client.verify_ssl,
    122        **kwargs,
    123    )
    124
    125    return _build_response(response=response)
    126
    127def sync(
    128    *,
    129    client: Client,
    130    json_body: ExplainabilityCreateConfigJsonBody,
    131
    132) -> Optional[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    133    """Create an explainability config
    134
    135     Creates an explainability config that can be used to create and compare analysis.
    136
    137    Args:
    138        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    139            explainability requests
    140
    141    Returns:
    142        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    143    """
    144
    145
    146    return sync_detailed(
    147        client=client,
    148json_body=json_body,
    149
    150    ).parsed
    151
    152async def asyncio_detailed(
    153    *,
    154    client: Client,
    155    json_body: ExplainabilityCreateConfigJsonBody,
    156
    157) -> Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    158    """Create an explainability config
    159
    160     Creates an explainability config that can be used to create and compare analysis.
    161
    162    Args:
    163        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    164            explainability requests
    165
    166    Returns:
    167        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    168    """
    169
    170
    171    kwargs = _get_kwargs(
    172        client=client,
    173json_body=json_body,
    174
    175    )
    176
    177    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    178        response = await _client.request(
    179            **kwargs
    180        )
    181
    182    return _build_response(response=response)
    183
    184async def asyncio(
    185    *,
    186    client: Client,
    187    json_body: ExplainabilityCreateConfigJsonBody,
    188
    189) -> Optional[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    190    """Create an explainability config
    191
    192     Creates an explainability config that can be used to create and compare analysis.
    193
    194    Args:
    195        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    196            explainability requests
    197
    198    Returns:
    199        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    200    """
    201
    202
    203    return (await asyncio_detailed(
    204        client=client,
    205json_body=json_body,
    206
    207    )).parsed

def sync_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body.ExplainabilityCreateConfigJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_400.ExplainabilityCreateConfigResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_401.ExplainabilityCreateConfigResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_500.ExplainabilityCreateConfigResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_200.ExplainabilityCreateConfigResponse200, NoneType]]: View Source

     96def sync_detailed(
     97    *,
     98    client: Client,
     99    json_body: ExplainabilityCreateConfigJsonBody,
    100
    101) -> Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    102    """Create an explainability config
    103
    104     Creates an explainability config that can be used to create and compare analysis.
    105
    106    Args:
    107        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    108            explainability requests
    109
    110    Returns:
    111        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    112    """
    113
    114
    115    kwargs = _get_kwargs(
    116        client=client,
    117json_body=json_body,
    118
    119    )
    120
    121    response = httpx.request(
    122        verify=client.verify_ssl,
    123        **kwargs,
    124    )
    125
    126    return _build_response(response=response)

Create an explainability config

Creates an explainability config that can be used to create and compare analysis.

Args: json_body (ExplainabilityCreateConfigJsonBody): A configuration for reference and adhoc explainability requests

Returns: Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]

def sync( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body.ExplainabilityCreateConfigJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_400.ExplainabilityCreateConfigResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_401.ExplainabilityCreateConfigResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_500.ExplainabilityCreateConfigResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_200.ExplainabilityCreateConfigResponse200, NoneType]: View Source

    128def sync(
    129    *,
    130    client: Client,
    131    json_body: ExplainabilityCreateConfigJsonBody,
    132
    133) -> Optional[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    134    """Create an explainability config
    135
    136     Creates an explainability config that can be used to create and compare analysis.
    137
    138    Args:
    139        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    140            explainability requests
    141
    142    Returns:
    143        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    144    """
    145
    146
    147    return sync_detailed(
    148        client=client,
    149json_body=json_body,
    150
    151    ).parsed

Create an explainability config

Creates an explainability config that can be used to create and compare analysis.

Args: json_body (ExplainabilityCreateConfigJsonBody): A configuration for reference and adhoc explainability requests

Returns: Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]

async def asyncio_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body.ExplainabilityCreateConfigJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_400.ExplainabilityCreateConfigResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_401.ExplainabilityCreateConfigResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_500.ExplainabilityCreateConfigResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_200.ExplainabilityCreateConfigResponse200, NoneType]]: View Source

    153async def asyncio_detailed(
    154    *,
    155    client: Client,
    156    json_body: ExplainabilityCreateConfigJsonBody,
    157
    158) -> Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    159    """Create an explainability config
    160
    161     Creates an explainability config that can be used to create and compare analysis.
    162
    163    Args:
    164        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    165            explainability requests
    166
    167    Returns:
    168        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    169    """
    170
    171
    172    kwargs = _get_kwargs(
    173        client=client,
    174json_body=json_body,
    175
    176    )
    177
    178    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    179        response = await _client.request(
    180            **kwargs
    181        )
    182
    183    return _build_response(response=response)

Create an explainability config

Creates an explainability config that can be used to create and compare analysis.

Args: json_body (ExplainabilityCreateConfigJsonBody): A configuration for reference and adhoc explainability requests

Returns: Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]

async def asyncio( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body.ExplainabilityCreateConfigJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_400.ExplainabilityCreateConfigResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_401.ExplainabilityCreateConfigResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_500.ExplainabilityCreateConfigResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_response_200.ExplainabilityCreateConfigResponse200, NoneType]: View Source

    185async def asyncio(
    186    *,
    187    client: Client,
    188    json_body: ExplainabilityCreateConfigJsonBody,
    189
    190) -> Optional[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]:
    191    """Create an explainability config
    192
    193     Creates an explainability config that can be used to create and compare analysis.
    194
    195    Args:
    196        json_body (ExplainabilityCreateConfigJsonBody):  A configuration for reference and adhoc
    197            explainability requests
    198
    199    Returns:
    200        Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]
    201    """
    202
    203
    204    return (await asyncio_detailed(
    205        client=client,
    206json_body=json_body,
    207
    208    )).parsed

Create an explainability config

Creates an explainability config that can be used to create and compare analysis.

Args: json_body (ExplainabilityCreateConfigJsonBody): A configuration for reference and adhoc explainability requests

Returns: Response[Union[ExplainabilityCreateConfigResponse400, ExplainabilityCreateConfigResponse401, ExplainabilityCreateConfigResponse500, Optional[ExplainabilityCreateConfigResponse200]]]