"""CloudLLMNode 启动文件

用法：
    ros2 launch cloud_llm_node cloud_llm_launch.py
"""

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
import os


def generate_launch_description():
    config_file = os.path.join(
        os.path.dirname(os.path.abspath(__file__)),
        '../config/cloud_llm_config.yaml'
    )

    return LaunchDescription([
        DeclareLaunchArgument('cloud_llm_api_key', default_value='', description='DeepSeek API Key'),
        DeclareLaunchArgument('cloud_llm_base_url', default_value='', description='API Base URL'),
        DeclareLaunchArgument('cloud_llm_model', default_value='', description='模型名称'),
        DeclareLaunchArgument('cloud_llm_timeout_sec', default_value='0', description='请求超时时间（秒）'),
        DeclareLaunchArgument('cloud_llm_enabled', default_value='', description='是否启用云端 LLM'),
        DeclareLaunchArgument('cloud_debug', default_value='', description='调试日志开关'),
        DeclareLaunchArgument('cloud_system_prompt_path', default_value='', description='自定义 System Prompt 文件路径'),

        Node(
            package='cloud_llm_node',
            executable='cloud_llm_node',
            name='cloud_llm_node',
            output='screen',
            parameters=[config_file],
            remappings=[
                ('/planner/llm_request', 'planner/llm_request'),
                ('/planner/llm_response', 'planner/llm_response'),
            ],
        ),
    ])

