nat.middleware.dynamic.dynamic_middleware_config#
Configuration for dynamic middleware.
Classes#
Component functions allowed for auto-registration. |
|
Configuration for dynamic middleware. |
Module Contents#
- class AllowedComponentFunctions(/, **data: Any)#
Bases:
pydantic.BaseModelComponent functions allowed for auto-registration.
Default allowlists are provided for each component type. User-provided values are automatically merged with defaults. Set to None or omit to use only defaults.
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.- merge_with_defaults()#
Merge user-provided values with defaults from COMPONENT_FUNCTION_ALLOWLISTS.
- class DynamicMiddlewareConfig(/, **data: Any)#
Bases:
nat.data_models.middleware.FunctionMiddlewareBaseConfigConfiguration for dynamic middleware.
Controls which components and functions to intercept, and which policies to apply. Supports explicit component references and auto-discovery flags.
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[nat.data_models.component_ref.LLMRef] | None = None#
- embedders: list[nat.data_models.component_ref.EmbedderRef] | None = None#
- retrievers: list[nat.data_models.component_ref.RetrieverRef] | None = None#
- memory: list[nat.data_models.component_ref.MemoryRef] | None = None#
- object_stores: list[nat.data_models.component_ref.ObjectStoreRef] | None = None#
- auth_providers: list[nat.data_models.component_ref.AuthenticationRef] | None = None#
- allowed_component_functions: AllowedComponentFunctions | None = None#