File size: 5,143 Bytes
428252c 93b2a9f 428252c 93b2a9f 428252c 13f4dbc 428252c 93b2a9f 428252c 8bcd9ed 428252c 93b2a9f 428252c 93b2a9f 428252c 93b2a9f 428252c |
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 173 174 175 176 177 178 179 180 181 |
# Table of Contents
* [RunCodeFlow](#RunCodeFlow)
* [RunCodeFlow](#RunCodeFlow.RunCodeFlow)
* [ExecuteCodeAtomicFlow](#ExecuteCodeAtomicFlow)
* [ExecuteCodeAtomicFlow](#ExecuteCodeAtomicFlow.ExecuteCodeAtomicFlow)
* [run](#ExecuteCodeAtomicFlow.ExecuteCodeAtomicFlow.run)
* [RunCodeAskUserFlow](#RunCodeAskUserFlow)
* [RunCodeAskUserFlow](#RunCodeAskUserFlow.RunCodeAskUserFlow)
* [run](#RunCodeAskUserFlow.RunCodeAskUserFlow.run)
* [library](#library)
* [run](#run)
* [RunCodeFileEditAtomicFlow](#RunCodeFileEditAtomicFlow)
* [RunCodeFileEditAtomicFlow](#RunCodeFileEditAtomicFlow.RunCodeFileEditAtomicFlow)
* [\_\_init\_\_](#__init__)
<a id="RunCodeFlow"></a>
# RunCodeFlow
<a id="RunCodeFlow.RunCodeFlow"></a>
## RunCodeFlow Objects
```python
class RunCodeFlow(SequentialFlow)
```
This flow is used to run code in a file. It opens up the file in VSCode and waits for the user to save and close the file.
Once the file is closed, it reads the code from the file and executes it. It then returns the output of the execution.
Finally, the flow asks the user for feedback on the execution of the code.
*Input Interface*:
- code: The code to be executed.
- language: The language of the code to be executed.
- memory_files: The dictionary containing the location of the code library.
*Output Interface*:
- summary: The summary of the execution of the code. (To be written to the logs of the caller flow)
- result: The result of the execution of the code. (To be returned to the controller of the caller flow)
*Configuration Parameters*:
- `input_interface`: The input interface of the flow. (Default: `['code', 'language', 'memory_files']`)
- `output_interface`: The output interface of the flow. (Default: `['summary', 'result']`)
- `subflows_config`: The configuration of the subflows of the flow.
- `early_exit_key`: The key to be pressed to exit the flow early.
- `topology`: The topology of the subflows.
<a id="ExecuteCodeAtomicFlow"></a>
# ExecuteCodeAtomicFlow
<a id="ExecuteCodeAtomicFlow.ExecuteCodeAtomicFlow"></a>
## ExecuteCodeAtomicFlow Objects
```python
class ExecuteCodeAtomicFlow(InterpreterAtomicFlow)
```
This class inherits from InterpreterAtomicFlow and is used to execute code in a file.
It opens up the file in VSCode and waits for the user to save and close the file. Once the file is saved and closed, it reads the code
from the file and executes it. It then returns the output of the execution.
*Input Interface*:
- temp_code_file_location: The location of the file containing the code to be executed.
- language: The language of the code to be executed.
*Output Interface*:
- interpreter_output: The output of the execution of the code.
- code_ran: The code that was executed.
*Configuration Parameters*:
- `input_interface`: The input interface of the atomic flow.
- `output_interface`: The output interface of the atomic flow.
<a id="ExecuteCodeAtomicFlow.ExecuteCodeAtomicFlow.run"></a>
#### run
```python
def run(input_data: Dict[str, Any])
```
This method is called when the atomic flow is called.
**Arguments**:
- `input_data` (`Dict[str, Any]`): The input_data dictionary.
**Returns**:
`Dict[str, Any]`: The output of the execution of the code.
<a id="RunCodeAskUserFlow"></a>
# RunCodeAskUserFlow
<a id="RunCodeAskUserFlow.RunCodeAskUserFlow"></a>
## RunCodeAskUserFlow Objects
```python
class RunCodeAskUserFlow(HumanStandardInputFlow)
```
Refer to: https://huggingface.co/aiflows/ExtendLibraryFlowModule/blob/main/ExtLibAskUserFlow.py
*Input Interface*:
- `question`: The question asked
*Expected Behaviour*:
- The question is displayed, and the user gives feedback by input string.
*Output Interface*:
- `result`: The input of the user.
- `summary`: The summary that will be written by the caller.
*Configuration Parameters*:
- `query_message_prompt_template`: The template of the message that is displayed to the user.
- `request_multi_line_input`: Whether the user should be able to input multiple lines. Default: False.
- `end_of_input_string`: The string that the user can input to indicate that he/she is done with the input. Default: EOI
<a id="RunCodeAskUserFlow.RunCodeAskUserFlow.run"></a>
#### run
```python
def run(input_data: Dict[str, Any]) -> Dict[str, Any]
```
Run the flow module.
**Arguments**:
- `input_data` (`Dict[str, Any]`): The input data.
**Returns**:
`Dict[str, Any]`: The output data.
<a id="library"></a>
# library
<a id="run"></a>
# run
<a id="RunCodeFileEditAtomicFlow"></a>
# RunCodeFileEditAtomicFlow
<a id="RunCodeFileEditAtomicFlow.RunCodeFileEditAtomicFlow"></a>
## RunCodeFileEditAtomicFlow Objects
```python
class RunCodeFileEditAtomicFlow(CodeFileEditAtomicFlow)
```
Refer to: https://huggingface.co/aiflows/CodeFileEditFlowModule
*Input Interface*:
- `code`: str
- `language_of_code`: str
- `memory_files`: Dict[str, str]
*Output Interface*:
- `code_editor_output`: str
- `temp_code_file_location`: str
*Configuration Parameters*:
- `input_interface`: The input interface of the atomic flow.
- `output_interface`: The output interface of the atomic flow.
<a id="__init__"></a>
# \_\_init\_\_
|