added feedback for if code runs or not
Browse filesFiles changed (2)
30 unmodified lines31323334353665 unmodified lines1021031041051061077 unmodified lines1151161171181191201216 unmodified lines12812913013113213313413513630 unmodified lines*Output Interface*:- `interpreter_output`: output of the code interpreter*Configuration Parameters*:- None65 unmodified linesdef _call(self):""" This method runs the code interpreter and returns the output. (runs the code interpreter and returns the output.)"""output = ""try:code_interpreter = self._code_interpreters[self.flow_state["language"]]7 unmodified linesexcept:output = traceback.format_exc()output = output.strip()return outputdef run(self,6 unmodified linesself._check_input(input_data)self._process_input_data(input_data)reply = self.package_output_message(input_message=input_message,response = {"interpreter_output": self._call()})self.send_message(reply)30 unmodified lines3132333435363765 unmodified lines1031041051061071081097 unmodified lines1171181191201211221231246 unmodified lines13113213313413513613713813914014114214314414514630 unmodified lines*Output Interface*:- `interpreter_output`: output of the code interpreter- `code_runs`: whether the code runs successfully or not*Configuration Parameters*:- None65 unmodified linesdef _call(self):""" This method runs the code interpreter and returns the output. (runs the code interpreter and returns the output.)"""code_runs = Trueoutput = ""try:code_interpreter = self._code_interpreters[self.flow_state["language"]]7 unmodified linesexcept:output = traceback.format_exc()output = output.strip()code_runs = Falsereturn output, code_runsdef run(self,6 unmodified linesself._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 = response)self.send_message(reply)
1234name: "InterpreterAtomicFlow"description: "A flow that compiles and runs codes"_target_: flow_modules.aiflows.InterpreterFlowModule.InterpreterAtomicFlow.instantiate_from_default_configmax_output: 2000123456789101112name: "InterpreterAtomicFlow"description: "A flow that compiles and runs codes"_target_: flow_modules.aiflows.InterpreterFlowModule.InterpreterAtomicFlow.instantiate_from_default_configmax_output: 2000input_interface:- "language"- "code"output_interface:- interpreter_output- code_runs
InterpreterAtomicFlow.py+12-2
InterpreterAtomicFlow.yaml+9-1