Update multi_agent.py
Browse files- 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 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
#print("### markdown_code = " + markdown_code)
|
| 93 |
|
| 94 |
#print("###")
|
| 95 |
#print(chat_result)
|
| 96 |
#print("###")
|
| 97 |
|
| 98 |
-
return markdown_code + "
|
|
|
|
| 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
|