add more docs & comments
Browse filesFiles changed (2)
20 unmodified lines2122232425261 unmodified line282930313233343536375 unmodified lines43444546474820 unmodified lines- `plan`- `feedback`- `temp_plan_file_location`"""REQUIRED_KEYS_CONFIG = ["max_rounds", "early_exit_key", "topology"]1 unmodified lineself,**kwargs):super().__init__(**kwargs)@classmethoddef instantiate_from_config(cls, config):flow_config = deepcopy(config)kwargs = {"flow_config": flow_config}5 unmodified linesreturn cls(**kwargs)def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:# ~~~ sets the input_data in the flow_state dict ~~~self._state_update_dict(update_data=input_data)20 unmodified lines21222324252627282930313233341 unmodified line363738394041424344454647484950515253545556575 unmodified lines6364656667686970717273747520 unmodified lines- `plan`- `feedback`- `temp_plan_file_location`*Configuration Parameters*:- `input_interface`: the input interface of the flow.- `output_interface`: the output interface of the flow.- `subflows_config`: the configuration of the subflows.- `early_exit_key`: the key in the state dict that indicates whether the flow should exit early.- `topology`: the topology of the subflows."""REQUIRED_KEYS_CONFIG = ["max_rounds", "early_exit_key", "topology"]1 unmodified lineself,**kwargs):"""This function initializes the flow.:param kwargs: the configuration of the flow.:type kwargs: Dict[str, Any]"""super().__init__(**kwargs)@classmethoddef instantiate_from_config(cls, config):"""This function instantiates the flow from a configuration.:param config: the configuration of the flow.:type config: Dict[str, Any]:return: the instantiated flow.:rtype: InteractivePlanGenFlow"""flow_config = deepcopy(config)kwargs = {"flow_config": flow_config}5 unmodified linesreturn cls(**kwargs)def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:"""This function runs the flow.:param input_data: the input data of the flow.:type input_data: Dict[str, Any]:return: the output data of the flow.:rtype: Dict[str, Any]"""# ~~~ sets the input_data in the flow_state dict ~~~self._state_update_dict(update_data=input_data)
12342 unmodified lines7891011121314151617181920212223242526274 unmodified lines323334353637383940414221 unmodified lines646566676869### Structure of InteractivePlanGenFlow```goal2 unmodified lines|v+------------------+| PlanGenerator | Generates plan given goal. (https://huggingface.co/Tachi67/PlanGeneratorFlowModule)+------------------+|| (plan)|v+-------------------+| PlanFileEdit | Edit a temp file with the plan generated. (https://huggingface.co/Tachi67/PlanFileEditFlowModule)+-------------------+|| (temp_plan_file_location)|v+------------------+| ParseFeedback | Opens up the temp file until user closes the file, parse for user feedback. (https://huggingface.co/Tachi67/ParseFeedbackFlowModule)+------------------+|| (plan, feedback)4 unmodified lines```# Table of Contents* [InteractivePlanGenFlow](#InteractivePlanGenFlow)* [InteractivePlanGenFlow](#InteractivePlanGenFlow.InteractivePlanGenFlow)* [\_\_init\_\_](#__init__)<a id="InteractivePlanGenFlow"></a>21 unmodified lines- `feedback`- `temp_plan_file_location`<a id="__init__"></a># \_\_init\_\_123456789101112131415162 unmodified lines1920212223242526272829303132333435363738394 unmodified lines4445464748495051525321 unmodified lines75767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138# Table of Contents* [Structure of InteractivePlanGenFlow](#structure-of-interactiveplangenflow)* [run](#run)* [InteractivePlanGenFlow](#InteractivePlanGenFlow)* [InteractivePlanGenFlow](#InteractivePlanGenFlow.InteractivePlanGenFlow)* [\_\_init\_\_](#InteractivePlanGenFlow.InteractivePlanGenFlow.__init__)* [instantiate\_from\_config](#InteractivePlanGenFlow.InteractivePlanGenFlow.instantiate_from_config)* [run](#InteractivePlanGenFlow.InteractivePlanGenFlow.run)* [\_\_init\_\_](#__init__)# Structure of InteractivePlanGenFlow```goal2 unmodified lines|v+------------------+| PlanGenerator | Generates plan given goal. (https://huggingface.co/aiflows/PlanGeneratorFlowModule)+------------------+|| (plan)|v+-------------------+| PlanFileEdit | Edit a temp file with the plan generated. (https://huggingface.co/aiflows/PlanFileEditFlowModule)+-------------------+|| (temp_plan_file_location)|v+------------------+| ParseFeedback | Opens up the temp file until user closes the file, parse for user feedback. (https://huggingface.co/aiflows/ParseFeedbackFlowModule)+------------------+|| (plan, feedback)4 unmodified lines```<a id="run"></a># run<a id="InteractivePlanGenFlow"></a>21 unmodified lines- `feedback`- `temp_plan_file_location`*Configuration Parameters*:- `input_interface`: the input interface of the flow.- `output_interface`: the output interface of the flow.- `subflows_config`: the configuration of the subflows.- `early_exit_key`: the key in the state dict that indicates whether the flow should exit early.- `topology`: the topology of the subflows.<a id="InteractivePlanGenFlow.InteractivePlanGenFlow.__init__"></a>#### \_\_init\_\_```pythondef __init__(**kwargs)```This function initializes the flow.**Arguments**:- `kwargs` (`Dict[str, Any]`): the configuration of the flow.<a id="InteractivePlanGenFlow.InteractivePlanGenFlow.instantiate_from_config"></a>#### instantiate\_from\_config```python@classmethoddef instantiate_from_config(cls, config)```This function instantiates the flow from a configuration.**Arguments**:- `config` (`Dict[str, Any]`): the configuration of the flow.**Returns**:`InteractivePlanGenFlow`: the instantiated flow.<a id="InteractivePlanGenFlow.InteractivePlanGenFlow.run"></a>#### run```pythondef run(input_data: Dict[str, Any]) -> Dict[str, Any]```This function runs the flow.**Arguments**:- `input_data` (`Dict[str, Any]`): the input data of the flow.**Returns**:`Dict[str, Any]`: the output data of the flow.<a id="__init__"></a># \_\_init\_\_
InteractivePlanGenFlow.py+27
README.md+77-8