File size: 3,174 Bytes
60f5c43 b9e485c 60f5c43 b9e485c 161700f b9e485c |
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# Table of Contents
* [Structure of ContentWriterFlow](#structure-of-contentwriterflow)
* [ContentWritrerFlow](#ContentWritrerFlow)
* [ContentWriterFlow](#ContentWritrerFlow.ContentWriterFlow)
* [detect\_finish\_or\_continue](#ContentWritrerFlow.ContentWriterFlow.detect_finish_or_continue)
* [\_\_init\_\_](#__init__)
# Structure of ContentWriterFlow
```
goal
|
v
+---------------+
| Controller | --------<<<<-----------+
+---------------+ |
| |
| (command, command args) |
| |
v |
+------------------+ |
| Executor | Each branch is an |
| (Tree Structure) | executor |
+------------------+ |
| ^
| (summary) |
| |
v |
| |
+-> goes back to the Controller>-+
```
This is an abstract class. It is inherited by [CodeWriterFlow](https://huggingface.co/aiflows/CodeWriterFlowModule) and [PlanWriterFlow](https://huggingface.co/aiflows/PlanWriterFlowModule)
<a id="ContentWritrerFlow"></a>
# ContentWritrerFlow
<a id="ContentWritrerFlow.ContentWriterFlow"></a>
## ContentWriterFlow Objects
```python
class ContentWriterFlow(CircularFlow, ABC)
```
This is an abstract class for writing content (plan, code)
The ContentWriterFlow is made of a controller and a branching executor.
Each time the controller is called, the controller decides whether to write content
or to finish. If the content writer executor is called, the executor will write content
in an interactive way, finally, the user is able to give feedback to the content, so that
the controller can decide whether to write content again or to finish.
*Configuration Parameters*:
- `name`: Name of the flow.
- `description`: description of the flow.
- `max_round`: Max round of execution of the CircularFlow.
- `subflows_config`:
- `Controller` (dict): The controller that decides whether to write content or to finish.
- `Executor` (dict): A branching flow, we configure the specific executor in the subflows of the executor.
- `early_exit_key`: The key of the early exit variable in the output payload of the executor.
- `topology`: The topology of the subflows, this describes the I/O interface instances.
*Input Interface*:
- `goal`
*Output Interface*:
- `answer`
- `status`
<a id="ContentWritrerFlow.ContentWriterFlow.detect_finish_or_continue"></a>
#### detect\_finish\_or\_continue
```python
@abstractmethod
@CircularFlow.output_msg_payload_processor
def detect_finish_or_continue(output_payload: Dict[str, Any],
src_flow) -> Dict[str, Any]
```
1. Writing content to file;
2. Finish and early exit.
<a id="__init__"></a>
# \_\_init\_\_
|