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.func.base.APIFunctionMeta(name, bases, attrs, **kwargs)

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


Return a type’s method resolution order.

class ai.backend.client.func.base.BaseFunction

Mark the wrapped method as the API function method.