Download PlanWriterAskUserFlow.py from Tachi67/PlanWriterFlowModule: direct link, hf CLI and curl.
- Browser
- Download file 948 Bytes
-
https://huggingface.co/Tachi67/PlanWriterFlowModule/resolve/d8f0684a2b6f4c64b33a2df4cb31bba620c808cf/PlanWriterAskUserFlow.py
- Command line
-
hf download hf://Tachi67/PlanWriterFlowModule@d8f0684a2b6f4c64b33a2df4cb31bba620c808cf/PlanWriterAskUserFlow.py
-
curl -L -o PlanWriterAskUserFlow.py https://huggingface.co/Tachi67/PlanWriterFlowModule/resolve/d8f0684a2b6f4c64b33a2df4cb31bba620c808cf/PlanWriterAskUserFlow.py
948 Bytes
| from flow_modules.aiflows.HumanStandardInputFlowModule import HumanStandardInputFlow | |
| from typing import Dict, Any | |
| from aiflows.messages import UpdateMessage_Generic | |
| from aiflows.utils import logging | |
| log = logging.get_logger(f"flows.{__name__}") | |
| class PlanWriterAskUserFlow(HumanStandardInputFlow): | |
| def run(self, | |
| input_data: Dict[str, Any]) -> Dict[str, Any]: | |
| query_message = self._get_message(self.query_message_prompt_template, input_data) | |
| state_update_message = UpdateMessage_Generic( | |
| created_by=self.flow_config['name'], | |
| updated_flow=self.flow_config["name"], | |
| data={"query_message": query_message}, | |
| ) | |
| self._log_message(state_update_message) | |
| log.info(query_message) | |
| human_input = self._read_input() | |
| response = {} | |
| response["feedback"] = human_input | |
| response["plan"] = "no plan was written" | |
| return response |