wallaroo.wallaroo_ml_ops_api_client.api.explainability.explainability_create_request API documentation

# wallaroo.wallaroo_ml_ops_api_client.api.explainability.explainability_create_request

View Source

      1from typing import Any, Dict, Optional, Union
      2
      3import httpx
      4
      5from ...client import Client
      6from ...models.explainability_create_request_json_body import \
      7    ExplainabilityCreateRequestJsonBody
      8from ...models.explainability_create_request_response_200 import \
      9    ExplainabilityCreateRequestResponse200
     10from ...models.explainability_create_request_response_400 import \
     11    ExplainabilityCreateRequestResponse400
     12from ...models.explainability_create_request_response_401 import \
     13    ExplainabilityCreateRequestResponse401
     14from ...models.explainability_create_request_response_500 import \
     15    ExplainabilityCreateRequestResponse500
     16from ...types import Response
     17
     18
     19def _get_kwargs(
     20    *,
     21    client: Client,
     22    json_body: ExplainabilityCreateRequestJsonBody,
     23
     24) -> Dict[str, Any]:
     25    url = "{}/v1/api/explainability/create_request".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[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
     54    if response.status_code == 500:
     55        response_500 = ExplainabilityCreateRequestResponse500.from_dict(response.json())
     56
     57
     58
     59        return response_500
     60    if response.status_code == 400:
     61        response_400 = ExplainabilityCreateRequestResponse400.from_dict(response.json())
     62
     63
     64
     65        return response_400
     66    if response.status_code == 401:
     67        response_401 = ExplainabilityCreateRequestResponse401.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[ExplainabilityCreateRequestResponse200]
     75        if _response_200 is None:
     76            response_200 = None
     77        else:
     78            response_200 = ExplainabilityCreateRequestResponse200.from_dict(_response_200)
     79
     80
     81
     82        return response_200
     83    return None
     84
     85
     86def _build_response(*, response: httpx.Response) -> Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
     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: ExplainabilityCreateRequestJsonBody,
     99
    100) -> Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    101    """Create an explainability request
    102
    103     Create an explainability request. Requests are processed asynchronously and results will be
    104    available after a delay.
    105
    106    Args:
    107        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    108            previously created config
    109
    110    Returns:
    111        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    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)
    127
    128def sync(
    129    *,
    130    client: Client,
    131    json_body: ExplainabilityCreateRequestJsonBody,
    132
    133) -> Optional[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    134    """Create an explainability request
    135
    136     Create an explainability request. Requests are processed asynchronously and results will be
    137    available after a delay.
    138
    139    Args:
    140        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    141            previously created config
    142
    143    Returns:
    144        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    145    """
    146
    147
    148    return sync_detailed(
    149        client=client,
    150json_body=json_body,
    151
    152    ).parsed
    153
    154async def asyncio_detailed(
    155    *,
    156    client: Client,
    157    json_body: ExplainabilityCreateRequestJsonBody,
    158
    159) -> Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    160    """Create an explainability request
    161
    162     Create an explainability request. Requests are processed asynchronously and results will be
    163    available after a delay.
    164
    165    Args:
    166        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    167            previously created config
    168
    169    Returns:
    170        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    171    """
    172
    173
    174    kwargs = _get_kwargs(
    175        client=client,
    176json_body=json_body,
    177
    178    )
    179
    180    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    181        response = await _client.request(
    182            **kwargs
    183        )
    184
    185    return _build_response(response=response)
    186
    187async def asyncio(
    188    *,
    189    client: Client,
    190    json_body: ExplainabilityCreateRequestJsonBody,
    191
    192) -> Optional[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    193    """Create an explainability request
    194
    195     Create an explainability request. Requests are processed asynchronously and results will be
    196    available after a delay.
    197
    198    Args:
    199        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    200            previously created config
    201
    202    Returns:
    203        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    204    """
    205
    206
    207    return (await asyncio_detailed(
    208        client=client,
    209json_body=json_body,
    210
    211    )).parsed

def sync_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body.ExplainabilityCreateRequestJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_400.ExplainabilityCreateRequestResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_401.ExplainabilityCreateRequestResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_500.ExplainabilityCreateRequestResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_200.ExplainabilityCreateRequestResponse200, NoneType]]: View Source

     96def sync_detailed(
     97    *,
     98    client: Client,
     99    json_body: ExplainabilityCreateRequestJsonBody,
    100
    101) -> Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    102    """Create an explainability request
    103
    104     Create an explainability request. Requests are processed asynchronously and results will be
    105    available after a delay.
    106
    107    Args:
    108        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    109            previously created config
    110
    111    Returns:
    112        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    113    """
    114
    115
    116    kwargs = _get_kwargs(
    117        client=client,
    118json_body=json_body,
    119
    120    )
    121
    122    response = httpx.request(
    123        verify=client.verify_ssl,
    124        **kwargs,
    125    )
    126
    127    return _build_response(response=response)

Create an explainability request

Create an explainability request. Requests are processed asynchronously and results will be available after a delay.

Args: json_body (ExplainabilityCreateRequestJsonBody): Create a request to be analyzed using a previously created config

Returns: Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]

def sync( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body.ExplainabilityCreateRequestJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_400.ExplainabilityCreateRequestResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_401.ExplainabilityCreateRequestResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_500.ExplainabilityCreateRequestResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_200.ExplainabilityCreateRequestResponse200, NoneType]: View Source

    129def sync(
    130    *,
    131    client: Client,
    132    json_body: ExplainabilityCreateRequestJsonBody,
    133
    134) -> Optional[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    135    """Create an explainability request
    136
    137     Create an explainability request. Requests are processed asynchronously and results will be
    138    available after a delay.
    139
    140    Args:
    141        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    142            previously created config
    143
    144    Returns:
    145        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    146    """
    147
    148
    149    return sync_detailed(
    150        client=client,
    151json_body=json_body,
    152
    153    ).parsed

Create an explainability request

Create an explainability request. Requests are processed asynchronously and results will be available after a delay.

Args: json_body (ExplainabilityCreateRequestJsonBody): Create a request to be analyzed using a previously created config

Returns: Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]

async def asyncio_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body.ExplainabilityCreateRequestJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_400.ExplainabilityCreateRequestResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_401.ExplainabilityCreateRequestResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_500.ExplainabilityCreateRequestResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_200.ExplainabilityCreateRequestResponse200, NoneType]]: View Source

    155async def asyncio_detailed(
    156    *,
    157    client: Client,
    158    json_body: ExplainabilityCreateRequestJsonBody,
    159
    160) -> Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    161    """Create an explainability request
    162
    163     Create an explainability request. Requests are processed asynchronously and results will be
    164    available after a delay.
    165
    166    Args:
    167        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    168            previously created config
    169
    170    Returns:
    171        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    172    """
    173
    174
    175    kwargs = _get_kwargs(
    176        client=client,
    177json_body=json_body,
    178
    179    )
    180
    181    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    182        response = await _client.request(
    183            **kwargs
    184        )
    185
    186    return _build_response(response=response)

Create an explainability request

Create an explainability request. Requests are processed asynchronously and results will be available after a delay.

Args: json_body (ExplainabilityCreateRequestJsonBody): Create a request to be analyzed using a previously created config

Returns: Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]

async def asyncio( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_json_body.ExplainabilityCreateRequestJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_400.ExplainabilityCreateRequestResponse400, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_401.ExplainabilityCreateRequestResponse401, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_500.ExplainabilityCreateRequestResponse500, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_request_response_200.ExplainabilityCreateRequestResponse200, NoneType]: View Source

    188async def asyncio(
    189    *,
    190    client: Client,
    191    json_body: ExplainabilityCreateRequestJsonBody,
    192
    193) -> Optional[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]:
    194    """Create an explainability request
    195
    196     Create an explainability request. Requests are processed asynchronously and results will be
    197    available after a delay.
    198
    199    Args:
    200        json_body (ExplainabilityCreateRequestJsonBody):  Create a request to be analyzed using a
    201            previously created config
    202
    203    Returns:
    204        Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]
    205    """
    206
    207
    208    return (await asyncio_detailed(
    209        client=client,
    210json_body=json_body,
    211
    212    )).parsed

Create an explainability request

Create an explainability request. Requests are processed asynchronously and results will be available after a delay.

Args: json_body (ExplainabilityCreateRequestJsonBody): Create a request to be analyzed using a previously created config

Returns: Response[Union[ExplainabilityCreateRequestResponse400, ExplainabilityCreateRequestResponse401, ExplainabilityCreateRequestResponse500, Optional[ExplainabilityCreateRequestResponse200]]]