File size: 708 Bytes
6defd55 b400d31 6defd55 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from typing import Dict, Any
from aiflows.base_flows import CircularFlow
from aiflows.utils import logging
from abc import ABC, abstractmethod
logging.set_verbosity_debug()
log = logging.get_logger(__name__)
class ContentWriterFlow(CircularFlow, ABC):
@abstractmethod
def _on_reach_max_round(self):
"""
should update flow state dictionary about the output variables and status.
"""
pass
@abstractmethod
@CircularFlow.output_msg_payload_processor
def detect_finish_or_continue(self, output_payload: Dict[str, Any], src_flow) -> Dict[str, Any]:
"""
1. Writing content to file;
2. Finish and early exit.
"""
pass
|