rixaplugin package

Subpackages

Submodules

rixaplugin.async_api module

Only here to prevent import errors. Not a real file.

API code is generated when plugin system is initialized. See api.BaseAPI for a list of all available functions.

rixaplugin.decorators module

rixaplugin.decorators.global_init()
rixaplugin.decorators.plugfunc(local_only: bool = False, tags: list | None = None)
rixaplugin.decorators.worker_init()

rixaplugin.settings module

rixaplugin.settings.ACCEPT_REMOTE_PLUGINS = 2

Whether or not to retrieve remote plugins. Usually set to true for servers and to false for clients. Only activate for clients when remote calling other plugins is required for your plugin code. 0: Deny, 1 Allow, 2 automatic

rixaplugin.settings.ALLOWED_PLUGIN_HOSTS = ['localhost']

List of domains which the plugin server serves. ‘*’ means all connections will be accepted.

rixaplugin.settings.ALLOW_NETWORK_RELAY = False

If there are servers A B and C, where B is this server, this setting controls if A can send messages to C through B, and vice versa. Usually this is only activated for the main server. This also controls whether this instance sends infos on connected plugins to newly connected instances. If activated on most/all servers, a decentralized system is possible (at cost of performance. Also kinda buggy as of now).

rixaplugin.settings.CONSOLE_USE_COLORS = True

Wether to print in colors to console. On some systems that isn’t supported in which case you will get flooded with control sequences. Use this to deactivate colors in the console.

rixaplugin.settings.DEFAULT_MAX_WORKERS = 4

Default number of worker threads for a plugin server. This is the number of threads or processes that can execute plugin code.

rixaplugin.settings.DISABLED_LOGGERS = ['daphne.http_protocol', 'daphne.server', 'daphne.ws_protocol', 'django.channels.server', 'openai', 'urllib3', 'matplotlib', 'sentence_transformers.SentenceTransformer', 'IPKernelApp', 'ipykernel', 'Comm', 'ipykernel.comm', 'httpcore', 'httpx', 'Comm']

Loggers that will be excluded on all outputs

rixaplugin.settings.LOG_FILE_TYPE = 'none'

Either none, html or txt. None means no log files are created. html supports color formatting while.

rixaplugin.settings.LOG_FMT = '%(levelname)s:%(name)s:%(session_id)s "%(message)s" (File "%(filename)s", line %(lineno)d)'

Format to be used for logging. See https://docs.python.org/3/library/logging.html#logrecord-attributes There is an additional session_id attribute. It’s behaviour is defined by LOG_UID_MODE

rixaplugin.settings.LOG_REMOTE_EXCEPTIONS_LOCALLY = True

Log exceptions (that occurred locally) but are meant for remote plugins to the local log stream

rixaplugin.settings.MAX_LOG_SIZE = 200

Max file size in kb before new logfile will be created. Normally there are 2 backup logfiles. 1 kb~6-9 log messages for txt and ~4-7 for html

rixaplugin.settings.PLUGIN_DEFAULT_ADDRESS = 'localhost'

Default to which plugin system will connect/listen to. Not used outside of RIXA webserver or CLI.

rixaplugin.settings.PLUGIN_DEFAULT_PORT = 15000

Port to which plugin system will bind to by default. Not used outside of RIXA webserver or CLI.

rixaplugin.settings.TMP_DATA_LOG_FOLDER = '/tmp/rixa_data_log'

Folder for api.datalog_to_tmp

rixaplugin.settings.logfile_path = 'log/main'

Where logfile is located. Without starting / it is considered relative to the working directory.

rixaplugin.sync_api module

Only here to prevent import errors. Not a real file.

API code is generated when plugin system is initialized. See api.BaseAPI for a list of all available functions.

Module contents

rixaplugin.execute(function_name, plugin_name=None, args=None, kwargs=None, timeout=30)

Execute a function in the plugin system synchronously i.e. wait for the result.

Parameters:
  • function_name

  • plugin_name

  • args

  • kwargs

  • timeout – Timeout in s before a TimeoutError is raised

Returns:

rixaplugin.execute_code(code, timeout=30)
rixaplugin.set_tags(plugin_name, tags)