File size: 658 Bytes
0660a86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from typing import Dict, Any

from flows.base_flows import SequentialFlow
from flows.utils import logging
from .PlanGeneratorAtomicFlow import PlanGeneratorAtomicFlow

logging.set_verbosity_debug()
log = logging.get_logger(__name__)

class WritePlanFlow(SequentialFlow):
    @SequentialFlow.output_msg_payload_processor
    def detect_finish_or_continue(self, output_payload: Dict[str, Any], src_flow: PlanGeneratorAtomicFlow) -> Dict[str, Any]:
        if "plan" not in output_payload:
            return {
                "EARLY_EXIT": True,
                "plan_writer_output": output_payload
            }
        else:
            return output_payload