nat.runtime.loader#

Attributes#

Classes#

PluginTypes

Support for integer-based Flags

Functions#

load_config(→ nat.data_models.config.Config)

This is the primary entry point for loading a NAT configuration file. It ensures that all plugins are

load_workflow(config_file[, max_concurrency])

Load the NAT configuration file and create an Runner object. This is the primary entry point for running

discover_entrypoints(plugin_type)

Discover all the requested plugin types which were registered via an entry point group and return them.

get_all_entrypoints_distro_mapping(→ dict[str, str])

Get the mapping of all NAT entry points to their distribution names.

discover_and_register_plugins(plugin_type)

Discover all the requested plugin types which were registered via an entry point group and register them into the

Module Contents#

logger#
class PluginTypes#

Bases: enum.IntFlag

Support for integer-based Flags

Initialize self. See help(type(self)) for accurate signature.

COMPONENT#

A plugin that is a component of the workflow. This includes tools, LLMs, retrievers, etc.

FRONT_END#

A plugin that is a front end for the workflow. This includes FastAPI, Gradio, etc.

EVALUATOR#

A plugin that is an evaluator for the workflow. This includes evaluators like RAGAS, SWE-bench, etc.

AUTHENTICATION#

A plugin that is an API authentication provider for the workflow. This includes Oauth2, API Key, etc.

REGISTRY_HANDLER#
CONFIG_OBJECT#

Any plugin that can be specified in the NAT configuration file.

ALL#

All plugin types

load_config(
config_file: nat.utils.type_utils.StrPath,
) nat.data_models.config.Config#

This is the primary entry point for loading a NAT configuration file. It ensures that all plugins are loaded and then validates the configuration file against the Config schema.

Parameters#

config_fileStrPath

The path to the configuration file

Returns#

Config

The validated Config object

async load_workflow(
config_file: nat.utils.type_utils.StrPath,
max_concurrency: int = -1,
)#

Load the NAT configuration file and create an Runner object. This is the primary entry point for running NAT workflows.

Parameters#

config_fileStrPath

The path to the configuration file

max_concurrencyint, optional

The maximum number of parallel workflow invocations to support. Specifying 0 or -1 will allow an unlimited count, by default -1

discover_entrypoints(plugin_type: PluginTypes)#

Discover all the requested plugin types which were registered via an entry point group and return them.

get_all_entrypoints_distro_mapping() dict[str, str]#

Get the mapping of all NAT entry points to their distribution names.

discover_and_register_plugins(plugin_type: PluginTypes)#

Discover all the requested plugin types which were registered via an entry point group and register them into the GlobalTypeRegistry.

get_all_aiq_entrypoints_distro_mapping#