File size: 4,581 Bytes
8c77957
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Table of Contents

* [SaveCodeAtomicFlow](#SaveCodeAtomicFlow)
  * [SaveCodeAtomicFlow](#SaveCodeAtomicFlow.SaveCodeAtomicFlow)
    * [run](#SaveCodeAtomicFlow.SaveCodeAtomicFlow.run)
* [ExtLibAskUserFlow](#ExtLibAskUserFlow)
  * [ExtLibAskUserFlow](#ExtLibAskUserFlow.ExtLibAskUserFlow)
* [ExtendLibraryFlow](#ExtendLibraryFlow)
  * [ExtendLibraryFlow](#ExtendLibraryFlow.ExtendLibraryFlow)
* [UpdatePlanAtomicFlow](#UpdatePlanAtomicFlow)
  * [UpdatePlanAtomicFlow](#UpdatePlanAtomicFlow.UpdatePlanAtomicFlow)
* [run\_ExtendLibrary](#run_ExtendLibrary)
* [CtrlExMem\_ExtLib](#CtrlExMem_ExtLib)
  * [CtrlExMem\_ExtLib](#CtrlExMem_ExtLib.CtrlExMem_ExtLib)
* [ControllerFlow\_ExtLib](#ControllerFlow_ExtLib)
  * [ControllerFlow\_ExtLib](#ControllerFlow_ExtLib.ControllerFlow_ExtLib)
* [\_\_init\_\_](#__init__)

<a id="SaveCodeAtomicFlow"></a>

# SaveCodeAtomicFlow

<a id="SaveCodeAtomicFlow.SaveCodeAtomicFlow"></a>

## SaveCodeAtomicFlow Objects

```python
class SaveCodeAtomicFlow(AtomicFlow)
```

This flow appends the code to the code library file.
*Input Interface*:
- `code` (str): the code to be appended to the code library
- `memory_files` (dict): the dictionary of memory files

*Output Interface*:
- `result` (str): the result of the flow, to be returned to the controller of the caller
- `summary` (str): the summary of the flow, to be appended to logs

<a id="SaveCodeAtomicFlow.SaveCodeAtomicFlow.run"></a>

#### run

```python
def run(input_data: Dict[str, Any])
```

Run the flow

**Arguments**:

- `input_data`: the input data

**Returns**:

the output data

<a id="ExtLibAskUserFlow"></a>

# ExtLibAskUserFlow

<a id="ExtLibAskUserFlow.ExtLibAskUserFlow"></a>

## ExtLibAskUserFlow Objects

```python
class ExtLibAskUserFlow(HumanStandardInputFlow)
```

This class is used to ask for user feedback whenever the controller is unsure of something, or need confirmation, etc.

*Expected Input*:
- `question`: The question asked by the controller

*Expected Behaviour*:
- The question is displayed, and the user gives feedback by inputing string.

*Expected Ouput*:
- `result`: The input of the user.
- `summary`: The summary that will be written by the caller.

<a id="ExtendLibraryFlow"></a>

# ExtendLibraryFlow

<a id="ExtendLibraryFlow.ExtendLibraryFlow"></a>

## ExtendLibraryFlow Objects

```python
class ExtendLibraryFlow(AbstractBossFlow)
```

ExtendLibraryFlow is one branch executor of CoderFlow. At a higher level, it takes the goal
from the Coder, writes functions in an interactive way, test the code and append the newly written function to
the code library.

Workflow of ExtendLibrary:
0. Coder calls ExtendLibrary with a goal.
1. MemoryReading reads logs, plan, and code library.
2. Planner makes a plan based on the goal.
3. Write code in an interactive fashion.
4. Test code.
5. Finish, writes code to the library.
Step 3-5 is done via prompting the controller.

*Input Interface (expected input)*
- `goal` (str): The goal from the caller (source flow, i.e. CoderFlow)
*Output Interface (expected output)*
- `result` (str): The result of the flow, the result will be returned to the caller (i.e. CoderFlow).
- `summary` (str): The summary of the flow, the summary will be logged into the logs of the caller flow (i.e. CoderFlow).

<a id="UpdatePlanAtomicFlow"></a>

# UpdatePlanAtomicFlow

<a id="UpdatePlanAtomicFlow.UpdatePlanAtomicFlow"></a>

## UpdatePlanAtomicFlow Objects

```python
class UpdatePlanAtomicFlow(AtomicFlow)
```

Refer to: https://huggingface.co/Tachi67/CoderFlowModule/blob/main/UpdatePlanAtomicFlow.py

<a id="run_ExtendLibrary"></a>

# run\_ExtendLibrary

<a id="CtrlExMem_ExtLib"></a>

# CtrlExMem\_ExtLib

<a id="CtrlExMem_ExtLib.CtrlExMem_ExtLib"></a>

## CtrlExMem\_ExtLib Objects

```python
class CtrlExMem_ExtLib(CtrlExMemFlow)
```

This class inherits from the CtrlExMemFlow class from AbstractBossFlowModule.
See: https://huggingface.co/Tachi67/AbstractBossFlowModule/blob/main/CtrlExMemFlow.py
*Input Interface*:
- `plan`
- `logs`
- `memory_files`
- `goal`
*Output Interface*
- `result` (str): The result of the flow, the result will be returned to the caller.
- `summary` (str): The summary of the flow, the summary will be logged into the logs of the caller flow.

<a id="ControllerFlow_ExtLib"></a>

# ControllerFlow\_ExtLib

<a id="ControllerFlow_ExtLib.ControllerFlow_ExtLib"></a>

## ControllerFlow\_ExtLib Objects

```python
class ControllerFlow_ExtLib(ChatAtomicFlow)
```

Refer to: https://huggingface.co/Tachi67/JarvisFlowModule/blob/main/Controller_JarvisFlow.py

<a id="__init__"></a>

# \_\_init\_\_