nat.utils#

Submodules#

Attributes#

_T

Functions#

run_workflow(→ _T)

Wrapper to run a workflow given either a config or a config file path and a prompt, returning the result in the

Package Contents#

_T#
async run_workflow(
*,
config: Config | None = None,
config_file: StrPath | None = None,
prompt: str,
to_type: type[_T] = str,
session_kwargs: dict[str, Any] | None = None,
) _T#

Wrapper to run a workflow given either a config or a config file path and a prompt, returning the result in the type specified by the to_type.

Parameters#

configConfig | None

The configuration object to use for the workflow. If None, config_file must be provided.

config_fileStrPath | None

The path to the configuration file. If None, config must be provided. Can be either a str or a Path object.

promptstr

The prompt to run the workflow with.

to_typetype[_T]

The type to convert the result to. Default is str.

Returns#

_T

The result of the workflow converted to the specified type.