nat.middleware.utils.workflow_inventory#
Attributes#
Classes#
Base class for discovered workflow items. |
|
Information about a discovered component and its available functions. |
|
Information about a discovered workflow function. |
|
Base class for registered callables. |
|
A workflow function registered for middleware interception. |
|
A component method registered for middleware interception. |
|
Inventory of discovered components and functions. |
Module Contents#
- COMPONENT_FUNCTION_ALLOWLISTS: dict[nat.data_models.component.ComponentGroup, set[str]]#
- class DiscoveredBase(/, **data: Any)#
Bases:
pydantic.BaseModelBase class for discovered workflow items.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- instance: Any = None#
- config: Any = None#
- class DiscoveredComponent(/, **data: Any)#
Bases:
DiscoveredBaseInformation about a discovered component and its available functions.
- Attributes:
name: Component name (e.g., “gpt4”, “milvus”) component_type: Component type instance: Component instance config: Component configuration callable_functions: A set of callable component function names on the instance
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- component_type: nat.data_models.component.ComponentGroup = None#
- class DiscoveredFunction(/, **data: Any)#
Bases:
pydantic.BaseModelInformation about a discovered workflow function.
- Attributes:
name: Function name (e.g., “my_api_handler”) config: Function configuration instance: Function instance
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- config: nat.data_models.function.FunctionBaseConfig = None#
- instance: nat.builder.function.Function = None#
- class RegisteredCallableBase(/, **data: Any)#
Bases:
pydantic.BaseModelBase class for registered callables.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class RegisteredFunction(/, **data: Any)#
Bases:
RegisteredCallableBaseA workflow function registered for middleware interception.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- function_instance: nat.builder.function.Function = None#
- class RegisteredComponentMethod(/, **data: Any)#
Bases:
RegisteredCallableBaseA component method registered for middleware interception.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- component_instance: Any = None#
- original_callable: collections.abc.Callable = None#
- class WorkflowInventory(/, **data: Any)#
Bases:
pydantic.BaseModelInventory of discovered components and functions.
This container holds all components and functions discovered from the workflow that are available for registration but not explicitly configured in the middleware config. It provides a structured view of everything that can be intercepted.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- llms: list[DiscoveredComponent] = None#
- embedders: list[DiscoveredComponent] = None#
- retrievers: list[DiscoveredComponent] = None#
- memory: list[DiscoveredComponent] = None#
- object_stores: list[DiscoveredComponent] = None#
- auth_providers: list[DiscoveredComponent] = None#
- workflow_functions: list[DiscoveredFunction] = None#