aihwkit.cloud.client.session module¶
Session handler for the AIHW Composer API.
-
class
aihwkit.cloud.client.session.
ApiSession
(api_url, api_token, verify=True)¶ Bases:
requests.sessions.Session
Session handler for requests to the AIHW Composer API.
Custom
Session
for 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.
-
request
(method, url, *args, **kwargs)¶ Construct a Request, prepares it and sends it.
- Parameters
method (str) – method for the new
Request
object.url (Union[str, bytes]) – URL for the new
Request
object.args (Any) – additional arguments for the original
requests
method.kwargs (Any) – additional arguments for the original
requests
method.
- Returns
A new
Response
object.- Raises
ApiResponseError – if the response did not have a valid status code.
- Return type
Any
-
update_jwt_token
(jwt_token)¶ Set the jwt token for the session.
- Parameters
jwt_token (str) –
- Return type
None
-
class
aihwkit.cloud.client.session.
ObjectStorageSession
¶ Bases:
requests.sessions.Session
Session handler for requests to object storage.
-
request
(method, url, *args, **kwargs)¶ Construct a Request, prepares it and sends it.
- Parameters
method (str) – method for the new
Request
object.url (Union[str, bytes]) – URL for the new
Request
object.args (Any) – additional arguments for the original
requests
method.kwargs (Any) – additional arguments for the original
requests
method.
- Returns
A new
Response
object.- Raises
ResponseError – if the response did not have a valid status code.
- Return type
Any
-