aihwkit.cloud.client.session module
Session handler for the AIHW Composer API.
- class aihwkit.cloud.client.session.ApiSession(api_url, api_token, verify=True)[source]
Bases:
SessionSession handler for requests to the AIHW Composer API.
Custom
Sessionfor interfacing with the AIHW Composer API, using:authorization based on jwt token.
custom user agent for the requests.
Additionally, this class stores information about the API URL and base token.
- Parameters:
api_url (str)
api_token (str)
verify (bool)
- request(method, url, *args, **kwargs)[source]
Construct a Request, prepares it and sends it.
- Parameters:
method (str) – method for the new
Requestobject.url (str | bytes) – URL for the new
Requestobject.args (Any) – additional arguments for the original
requestsmethod.kwargs (Any) – additional arguments for the original
requestsmethod.
- Returns:
A new
Responseobject.- Raises:
ApiResponseError – if the response did not have a valid status code.
- Return type:
Any
- class aihwkit.cloud.client.session.ObjectStorageSession[source]
Bases:
SessionSession handler for requests to object storage.
- request(method, url, *args, **kwargs)[source]
Construct a Request, prepares it and sends it.
- Parameters:
method (str) – method for the new
Requestobject.url (str | bytes) – URL for the new
Requestobject.args (Any) – additional arguments for the original
requestsmethod.kwargs (Any) – additional arguments for the original
requestsmethod.
- Returns:
A new
Responseobject.- Raises:
ResponseError – if the response did not have a valid status code.
- Return type:
Any