import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource


def generate_launch_description():

    deps = ["llm_supervisor", "greet_task", "ollama_connector", "db_connector"]

    nodes = []

    for dep in deps:
        nodes.append(IncludeLaunchDescription(
          PythonLaunchDescriptionSource([os.path.join(
          get_package_share_directory(dep), 'launch'), f'/{dep}.launch.py'])
        ))

    return LaunchDescription(nodes)

