added feedback for if code runs or not
Browse filesFiles changed (2)
30 unmodified lines3132333435363765 unmodified lines1031041051061071081097 unmodified lines1171181191201181211221231246 unmodified lines13113213313413513613713813914014114213314314414514630 unmodified lines *Output Interface*: - `interpreter_output`: output of the code interpreter - `code_runs`: whether the code runs successfully or not
*Configuration Parameters*: - None65 unmodified lines def _call(self): """ This method runs the code interpreter and returns the output. (runs the code interpreter and returns the output.) """ code_runs = True output = "" try: code_interpreter = self._code_interpreters[self.flow_state["language"]]7 unmodified lines except: output = traceback.format_exc() output = output.strip() code_runs = False return output return output, code_runs
def run( self,6 unmodified lines self._check_input(input_data) self._process_input_data(input_data) output = self._call() response = { "interpreter_output": output[0], "code_runs": output[1] } reply = self.package_output_message( input_message=input_message, response = {"interpreter_output": self._call()} response = response ) self.send_message(reply)1234456789101112name: "InterpreterAtomicFlow"description: "A flow that compiles and runs codes"_target_: flow_modules.aiflows.InterpreterFlowModule.InterpreterAtomicFlow.instantiate_from_default_configmax_output: 2000max_output: 2000
input_interface: - "language" - "code"
output_interface: - interpreter_output - code_runsInterpreterAtomicFlow.py+12-2
InterpreterAtomicFlow.yaml+9-1