Upload 3 files
Browse files- InteractivePlanGenFlow.py +1 -10
- InteractivePlanGenFlow.yaml +1 -13
InteractivePlanGenFlow.py
CHANGED
|
@@ -8,15 +8,13 @@ logging.set_verbosity_debug()
|
|
| 8 |
log = logging.get_logger(__name__)
|
| 9 |
|
| 10 |
class InteractivePlanGenFlow(SequentialFlow):
|
| 11 |
-
REQUIRED_KEYS_CONFIG = ["max_rounds", "early_exit_key", "topology"
|
| 12 |
|
| 13 |
def __init__(
|
| 14 |
self,
|
| 15 |
-
memory_files: Dict[str, Any],
|
| 16 |
**kwargs
|
| 17 |
):
|
| 18 |
super().__init__(**kwargs)
|
| 19 |
-
self.memory_files = memory_files
|
| 20 |
|
| 21 |
@classmethod
|
| 22 |
def instantiate_from_config(cls, config):
|
|
@@ -24,10 +22,6 @@ class InteractivePlanGenFlow(SequentialFlow):
|
|
| 24 |
|
| 25 |
kwargs = {"flow_config": flow_config}
|
| 26 |
|
| 27 |
-
# ~~~ Set up memory file ~~~
|
| 28 |
-
memory_files = flow_config["memory_files"]
|
| 29 |
-
kwargs.update({"memory_files": memory_files})
|
| 30 |
-
|
| 31 |
# ~~~ Set up subflows ~~~
|
| 32 |
kwargs.update({"subflows": cls._set_up_subflows(flow_config)})
|
| 33 |
|
|
@@ -38,9 +32,6 @@ class InteractivePlanGenFlow(SequentialFlow):
|
|
| 38 |
# ~~~ sets the input_data in the flow_state dict ~~~
|
| 39 |
self._state_update_dict(update_data=input_data)
|
| 40 |
|
| 41 |
-
# ~~~ set the memory file to the flow state ~~~
|
| 42 |
-
self._state_update_dict(update_data={"memory_files": self.memory_files})
|
| 43 |
-
|
| 44 |
max_rounds = self.flow_config.get("max_rounds", 1)
|
| 45 |
if max_rounds is None:
|
| 46 |
log.info(f"Running {self.flow_config['name']} without `max_rounds` until the early exit condition is met.")
|
|
|
|
| 8 |
log = logging.get_logger(__name__)
|
| 9 |
|
| 10 |
class InteractivePlanGenFlow(SequentialFlow):
|
| 11 |
+
REQUIRED_KEYS_CONFIG = ["max_rounds", "early_exit_key", "topology"]
|
| 12 |
|
| 13 |
def __init__(
|
| 14 |
self,
|
|
|
|
| 15 |
**kwargs
|
| 16 |
):
|
| 17 |
super().__init__(**kwargs)
|
|
|
|
| 18 |
|
| 19 |
@classmethod
|
| 20 |
def instantiate_from_config(cls, config):
|
|
|
|
| 22 |
|
| 23 |
kwargs = {"flow_config": flow_config}
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# ~~~ Set up subflows ~~~
|
| 26 |
kwargs.update({"subflows": cls._set_up_subflows(flow_config)})
|
| 27 |
|
|
|
|
| 32 |
# ~~~ sets the input_data in the flow_state dict ~~~
|
| 33 |
self._state_update_dict(update_data=input_data)
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
max_rounds = self.flow_config.get("max_rounds", 1)
|
| 36 |
if max_rounds is None:
|
| 37 |
log.info(f"Running {self.flow_config['name']} without `max_rounds` until the early exit condition is met.")
|
InteractivePlanGenFlow.yaml
CHANGED
|
@@ -3,10 +3,9 @@ description: "Generate step by step plan as goal requests, open up a temp file f
|
|
| 3 |
|
| 4 |
_target_: Tachi67.InteractivePlanGenFlowModule.InteractivePlanGenFlow.instantiate_from_default_config
|
| 5 |
|
| 6 |
-
memory_files: ???
|
| 7 |
-
|
| 8 |
input_interface:
|
| 9 |
- "goal"
|
|
|
|
| 10 |
|
| 11 |
output_interface:
|
| 12 |
- "plan"
|
|
@@ -14,9 +13,6 @@ output_interface:
|
|
| 14 |
- "temp_plan_file_location"
|
| 15 |
|
| 16 |
subflows_config:
|
| 17 |
-
MemoryReading:
|
| 18 |
-
_target_: Tachi67.MemoryReadingFlowModule.MemoryReadingAtomicFlow.instantiate_from_default_config
|
| 19 |
-
|
| 20 |
PlanGenerator:
|
| 21 |
_target_: Tachi67.PlanGeneratorFlowModule.PlanGeneratorAtomicFlow.instantiate_from_default_config
|
| 22 |
backend:
|
|
@@ -37,14 +33,6 @@ subflows_config:
|
|
| 37 |
early_exit_key: "EARLY_EXIT"
|
| 38 |
|
| 39 |
topology:
|
| 40 |
-
- goal: "Read in necessary memory"
|
| 41 |
-
input_interface:
|
| 42 |
-
_target_: flows.interfaces.KeyInterface
|
| 43 |
-
additional_transformations:
|
| 44 |
-
- _target_: flows.data_transformations.KeyMatchInput
|
| 45 |
-
flow: MemoryReading
|
| 46 |
-
reset: false
|
| 47 |
-
|
| 48 |
- goal: "Generate plan to achieve the task."
|
| 49 |
input_interface:
|
| 50 |
_target_: flows.interfaces.KeyInterface
|
|
|
|
| 3 |
|
| 4 |
_target_: Tachi67.InteractivePlanGenFlowModule.InteractivePlanGenFlow.instantiate_from_default_config
|
| 5 |
|
|
|
|
|
|
|
| 6 |
input_interface:
|
| 7 |
- "goal"
|
| 8 |
+
- "plan_file_location"
|
| 9 |
|
| 10 |
output_interface:
|
| 11 |
- "plan"
|
|
|
|
| 13 |
- "temp_plan_file_location"
|
| 14 |
|
| 15 |
subflows_config:
|
|
|
|
|
|
|
|
|
|
| 16 |
PlanGenerator:
|
| 17 |
_target_: Tachi67.PlanGeneratorFlowModule.PlanGeneratorAtomicFlow.instantiate_from_default_config
|
| 18 |
backend:
|
|
|
|
| 33 |
early_exit_key: "EARLY_EXIT"
|
| 34 |
|
| 35 |
topology:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
- goal: "Generate plan to achieve the task."
|
| 37 |
input_interface:
|
| 38 |
_target_: flows.interfaces.KeyInterface
|