datarobot_genai.nat.helpers
helpers
remove_datarobot_moderation_middleware
Remove datarobot_moderation middleware entries from a NAT workflow config.
DRUM applies LLM guardrails via moderation_config.yaml outside the NAT workflow.
When NatAgent loads a shared workflow.yaml through DRUM, strip the NAT
middleware so guardrails are not applied twice.
Source code in datarobot_genai/nat/helpers.py
load_config
load_config(config_file: StrPath, headers: dict[str, str] | None = None, *, disable_datarobot_moderation: bool = False) -> Config
Load a NAT configuration file with injected headers. It ensures that all plugins are loaded and then validates the configuration file against the Config schema.
Parameters
config_file : StrPath
The path to the configuration file
disable_datarobot_moderation : bool, optional
When True, strip datarobot_moderation middleware from the loaded config.
Used by NatAgent on the DRUM path where guardrails are applied externally.
Returns
Config The validated Config object
Source code in datarobot_genai/nat/helpers.py
load_workflow
async
load_workflow(config_file: StrPath, max_concurrency: int = -1, headers: dict[str, str] | None = None, *, disable_datarobot_moderation: bool = False) -> AsyncGenerator[Workflow, None]
Load the NAT configuration file and create a Runner object. This is the primary entry point for running NAT workflows with injected headers.
Parameters
config_file : StrPath
The path to the configuration file
max_concurrency : int, optional
The maximum number of parallel workflow invocations to support. Specifying 0 or -1 will
allow an unlimited count, by default -1
disable_datarobot_moderation : bool, optional
When True, strip datarobot_moderation middleware from the loaded config.
Used by NatAgent on the DRUM path where guardrails are applied externally.