Update CodeWriterFlow.py
Browse files- CodeWriterFlow.py +17 -1
CodeWriterFlow.py
CHANGED
|
@@ -57,4 +57,20 @@ class CodeWriterFlow(ContentWriterFlow):
|
|
| 57 |
|
| 58 |
return output_payload
|
| 59 |
else:
|
| 60 |
-
return output_payload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
return output_payload
|
| 59 |
else:
|
| 60 |
+
return output_payload
|
| 61 |
+
|
| 62 |
+
def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:
|
| 63 |
+
# ~~~ sets the input_data in the flow_state dict ~~~
|
| 64 |
+
self._state_update_dict(update_data=input_data)
|
| 65 |
+
|
| 66 |
+
max_rounds = self.flow_config.get("max_rounds", 1)
|
| 67 |
+
if max_rounds is None:
|
| 68 |
+
log.info(f"Running {self.flow_config['name']} without `max_rounds` until the early exit condition is met.")
|
| 69 |
+
|
| 70 |
+
self._sequential_run(max_rounds=max_rounds)
|
| 71 |
+
|
| 72 |
+
output = self._get_output_from_state()
|
| 73 |
+
|
| 74 |
+
self.reset(full_reset=True, recursive=True, src_flow=self)
|
| 75 |
+
|
| 76 |
+
return output
|