Update ExecuteCodeAtomicFlow.py
Browse files- ExecuteCodeAtomicFlow.py +12 -0
ExecuteCodeAtomicFlow.py
CHANGED
|
@@ -6,6 +6,18 @@ from flow_modules.Tachi67.InterpreterFlowModule import InterpreterAtomicFlow
|
|
| 6 |
|
| 7 |
|
| 8 |
class ExecuteCodeAtomicFlow(InterpreterAtomicFlow):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
def _prepare_code(self, input_data: Dict[str, Any]):
|
| 10 |
file_location = input_data["temp_code_file_location"]
|
| 11 |
start_marker = "# Code:\n"
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
class ExecuteCodeAtomicFlow(InterpreterAtomicFlow):
|
| 9 |
+
"""This class inherits from InterpreterAtomicFlow and is used to execute code in a file.
|
| 10 |
+
It opens up the file in VSCode and waits for the user to save the file. Once the file is saved, it reads the code
|
| 11 |
+
from the file and executes it. It then returns the output of the execution.
|
| 12 |
+
|
| 13 |
+
*Input Interface*:
|
| 14 |
+
- temp_code_file_location: The location of the file containing the code to be executed.
|
| 15 |
+
- language: The language of the code to be executed.
|
| 16 |
+
|
| 17 |
+
*Output Interface*:
|
| 18 |
+
- interpreter_output: The output of the execution of the code.
|
| 19 |
+
- code_ran: The code that was executed.
|
| 20 |
+
"""
|
| 21 |
def _prepare_code(self, input_data: Dict[str, Any]):
|
| 22 |
file_location = input_data["temp_code_file_location"]
|
| 23 |
start_marker = "# Code:\n"
|