"""接口层 - 提示链执行接口"""
from abc import ABC, abstractmethod
from typing import Dict, Any, List


class ChainExecutor(ABC):
    """提示链执行接口"""

    @abstractmethod
    async def execute_chain(
        self,
        chain_steps: List[Dict[str, Any]],
        initial_input: Dict[str, Any]
    ) -> Dict[str, Any]:
        """
        执行提示链

        Args:
            chain_steps: 提示链步骤列表
                [
                    {
                        "name": "step1_extract",
                        "prompt_file": "step1_extract.yaml",
                        "output_key": "extracted_data"
                    },
                    {
                        "name": "step2_analyze",
                        "prompt_file": "step2_analyze.yaml",
                        "input_from": "extracted_data",
                        "output_key": "analysis_result"
                    }
                ]
            initial_input: 初始输入变量
                {"content": "待处理文本...", "other_var": "value"}

        Returns:
            最终结果和中间结果
            {
                "final_result": {...},
                "steps": [
                    {"name": "step1_extract", "result": {...}},
                    {"name": "step2_analyze", "result": {...}}
                ]
            }
        """
        pass
