inspect_flow.api
Python API
config
Return the flow spec configuration.
def config(
spec: FlowSpec,
base_dir: str | None = None,
*,
log_level: str = DEFAULT_LOG_LEVEL,
) -> strspecFlowSpec-
The flow spec configuration.
base_dirstr | None-
The base directory for resolving relative paths. Defaults to the current working directory.
log_levelstr-
The Inspect Flow log level to use. Use spec.options.log_level to set the Inspect AI log level.
load_spec
Load a spec from file.
def load_spec(
file: str,
*,
log_level: str = DEFAULT_LOG_LEVEL,
args: dict[str, Any] | None = None,
) -> FlowSpecfilestr-
The path to the spec file.
log_levelstr-
The Inspect Flow log level to use. Use spec.options.log_level to set the Inspect AI log level.
argsdict[str, Any] | None-
A dictionary of arguments to pass as kwargs to the function in the flow config.
run
Run an inspect_flow evaluation.
def run(
spec: FlowSpec,
base_dir: str | None = None,
*,
dry_run: bool = False,
log_level: str = DEFAULT_LOG_LEVEL,
no_dotenv: bool = False,
) -> NonespecFlowSpec-
The flow spec configuration.
base_dirstr | None-
The base directory for resolving relative paths. Defaults to the current working directory.
dry_runbool-
If True, do not run eval, but show a count of tasks that would be run.
log_levelstr-
The Inspect Flow log level to use. Use spec.options.log_level to set the Inspect AI log level.
no_dotenvbool-
If True, do not load environment variables from a .env file.