Tachi67 commited on
Commit
7bb2097
·
1 Parent(s): 5421e10

Upload 10 files

Browse files
ExecuteCodeAtomicFlow.py CHANGED
@@ -32,10 +32,7 @@ class ExecuteCodeAtomicFlow(InterpreterAtomicFlow):
32
  os.remove(file_location)
33
 
34
  def _open_file_and_wait_for_upd(self, file_location):
35
- try:
36
- process = subprocess.Popen(["code", file_location])
37
- except Exception:
38
- raise
39
  while True:
40
  if process.poll() is not None:
41
  break
@@ -51,6 +48,5 @@ class ExecuteCodeAtomicFlow(InterpreterAtomicFlow):
51
  self._process_input_data(input_data)
52
  execution_output = self._call()
53
  self._delete_file(file_loc)
54
- code_ran = input_data["code"].deepcopy()
55
- response = {"interpreter_output": execution_output, "code_ran": code_ran}
56
  return response
 
32
  os.remove(file_location)
33
 
34
  def _open_file_and_wait_for_upd(self, file_location):
35
+ process = subprocess.Popen(["code", "--wait", file_location])
 
 
 
36
  while True:
37
  if process.poll() is not None:
38
  break
 
48
  self._process_input_data(input_data)
49
  execution_output = self._call()
50
  self._delete_file(file_loc)
51
+ response = {"interpreter_output": execution_output, "code_ran": input_data['code']}
 
52
  return response
RunCodeAskUserFlow.yaml CHANGED
@@ -1,4 +1,12 @@
1
  _target_: Tachi67.RunCodeFlowModule.RunCodeAskUserFlow.instantiate_from_default_config
 
 
 
 
 
 
 
 
2
  request_multi_line_input_flag: False
3
  end_of_input_string: EOI
4
 
 
1
  _target_: Tachi67.RunCodeFlowModule.RunCodeAskUserFlow.instantiate_from_default_config
2
+
3
+ input_interface:
4
+ - "interpreter_output"
5
+ - "code_ran"
6
+ output_interface:
7
+ - "summary"
8
+ - "result"
9
+
10
  request_multi_line_input_flag: False
11
  end_of_input_string: EOI
12
 
RunCodeFileEditAtomicFlow.py CHANGED
@@ -28,7 +28,7 @@ class RunCodeFileEditAtomicFlow(CodeFileEditAtomicFlow):
28
 
29
  def _generate_temp_file_location(self, code_lib_location, file_extension):
30
  directory = os.path.dirname(code_lib_location)
31
- ret = os.path.join(directory, 'run_code_temp'+'.'+file_extension)
32
  return ret
33
 
34
  def _check_input(self, input_data: Dict[str, Any]):
 
28
 
29
  def _generate_temp_file_location(self, code_lib_location, file_extension):
30
  directory = os.path.dirname(code_lib_location)
31
+ ret = os.path.join(directory, 'run_code_temp'+file_extension)
32
  return ret
33
 
34
  def _check_input(self, input_data: Dict[str, Any]):