hoops_ai.flowmanager.flow

Functions

setup_logger(name, log_directory)

Sets up and returns a logger, placing the log file in the given directory.

Classes

Flow(name, specifications[, tasks])

Class to manage and orchestrate the execution of multiple Tasks.

FlowOutput(flow_spec, task_instances, ...)

Class to encapsulate the results, errors, and logs from the Flow execution.

class hoops_ai.flowmanager.flow.Flow(name, specifications, tasks=None)

Bases: object

Class to manage and orchestrate the execution of multiple Tasks.

Parameters:
log_flow_summary()

Logs a summary of the flow execution, detailing each task’s inputs and outputs.

print_flow_task_registry()

Prints information about tasks specifically assigned to this flow. This shows only the tasks that will be executed in this flow instance.

process(inputs)

Executes the flow by running tasks in sequence based on their dependencies.

Parameters:

inputs (Dict[str, List[Any]]) – A dictionary of inputs available to the flow.

Returns:

An instance of FlowOutput containing results, errors, and logs.

Return type:

Tuple[FlowOutput, Dict[str, Any], str]

class hoops_ai.flowmanager.flow.FlowOutput(flow_spec, task_instances, flow_name, time_to_process)

Bases: object

Class to encapsulate the results, errors, and logs from the Flow execution.

Parameters:
flow_name: str
flow_spec: Dict[str, Any]
generate_flow_summary(file_path)

Generates a JSON summary of the flow execution and saves it to a file.

Parameters:

file_path (str) – The path to the file where the JSON summary will be saved.

summary()

Generates a summary of the flow execution.

Returns:

A formatted string summarizing the execution results.

Return type:

str

task_instances: List[ParallelTask]
time_to_process: float
hoops_ai.flowmanager.flow.setup_logger(name, log_directory)

Sets up and returns a logger, placing the log file in the given directory.

Parameters:
  • name (str) – The name of the logger.

  • log_directory (str) – Path to the directory where logs should be stored.

Returns:

Configured logger instance.

Return type:

Logger