bstraehle commited on
Commit
e90039b
1 Parent(s): a52bed3

Update multi_agent.py

Browse files
Files changed (1) hide show
  1. multi_agent.py +26 -12
multi_agent.py CHANGED
@@ -77,22 +77,36 @@ def run_multi_agent(llm, message):
77
  print("#" + file_name_py)
78
  print("#" + file_name_sh)
79
 
80
- file_path_py = "coding/" + file_name_py
81
- print("##" + file_path_py)
82
- code_py = read_file(file_path_py)
83
- markdown_code_py = format_as_markdown(code_py)
84
- print("### " + markdown_code_py)
85
-
86
- file_path_sh = "coding/" + file_name_sh
87
- print("##" + file_path_sh)
88
- code_sh = read_file(file_path_sh)
89
- markdown_code_sh = format_as_markdown(code_sh)
90
- print("### " + markdown_code_sh)
 
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  #print("### markdown_code = " + markdown_code)
93
 
94
  #print("###")
95
  #print(chat_result)
96
  #print("###")
97
 
98
- return markdown_code + "<br />" + markdown_code_sh + "<br />" + markdown_code_py
 
77
  print("#" + file_name_py)
78
  print("#" + file_name_sh)
79
 
80
+ try:
81
+ file_path_py = "coding/" + file_name_py
82
+ print("##" + file_path_py)
83
+ code_py = read_file(file_path_py)
84
+ markdown_code_py = format_as_markdown(code_py)
85
+ print("### " + markdown_code_py)
86
+ except FileNotFoundError:
87
+ print(f"Error: File '{file_path_sh}' not found.")
88
+ except IOError as e:
89
+ print(f"Error reading file '{file_path_sh}': {e.strerror}")
90
+ except Exception as e:
91
+ print(f"An unexpected error occurred: {e}")
92
 
93
+ try:
94
+ file_path_sh = "coding/" + file_name_sh
95
+ print("##" + file_path_sh)
96
+ code_sh = read_file(file_path_sh)
97
+ markdown_code_sh = format_as_markdown(code_sh)
98
+ print("### " + markdown_code_sh)
99
+ except FileNotFoundError:
100
+ print(f"Error: File '{file_path_sh}' not found.")
101
+ except IOError as e:
102
+ print(f"Error reading file '{file_path_sh}': {e.strerror}")
103
+ except Exception as e:
104
+ print(f"An unexpected error occurred: {e}")
105
+
106
  #print("### markdown_code = " + markdown_code)
107
 
108
  #print("###")
109
  #print(chat_result)
110
  #print("###")
111
 
112
+ return markdown_code + "\n" + markdown_code_sh + "\n" + markdown_code_py