Base Function

This module defines a few utilities that ease complexities to support both synchronous and asynchronous API functions, using some tricks with Python metaclasses.

Unless your are contributing to the client SDK, probably you won’t have to use this module directly.

class ai.backend.client.base.APIFunctionMeta(name, bases, attrs, **kwargs)[source]

Converts all methods marked with api_function() into session-aware methods that are either plain Python functions or coroutines.

mro() → list

return a type’s method resolution order

class ai.backend.client.base.BaseFunction[source]

The class used to build API functions proxies bound to specific session instances.

@ai.backend.client.base.api_function(meth)[source]

Mark the wrapped method as the API function method.