Update multi_agent.py
Browse files- multi_agent.py +3 -16
multi_agent.py
CHANGED
|
@@ -50,18 +50,6 @@ def run_multi_agent(llm, message):
|
|
| 50 |
max_turns=10
|
| 51 |
)
|
| 52 |
|
| 53 |
-
chat_history_dict = chat_result.to_dict()
|
| 54 |
-
|
| 55 |
-
# Convert the dictionary to a JSON string
|
| 56 |
-
chat_history_json = json.dumps(chat_history_dict)
|
| 57 |
-
|
| 58 |
-
# Parse the JSON string
|
| 59 |
-
chat_history_parsed = json.loads(chat_history_json)
|
| 60 |
-
|
| 61 |
-
# Iterate over the messages and print the role and content
|
| 62 |
-
for message in chat_history_parsed["messages"]:
|
| 63 |
-
chat_history += f"Role: {message['role']}, Content: {message['content']}\n"
|
| 64 |
-
|
| 65 |
image_data = read_image_file("/home/user/app/coding/ytd_stock_gains.png")
|
| 66 |
markdown_code_png = generate_markdown_image(image_data)
|
| 67 |
|
|
@@ -91,11 +79,10 @@ def run_multi_agent(llm, message):
|
|
| 91 |
except Exception as e:
|
| 92 |
print(f"An unexpected error occurred: {e}")
|
| 93 |
|
| 94 |
-
result = markdown_code_png + "\n" + markdown_code_sh + "\n" + markdown_code_py
|
| 95 |
|
| 96 |
-
print("===")
|
| 97 |
-
print(chat_history)
|
| 98 |
#print(result)
|
| 99 |
-
print("===")
|
| 100 |
|
| 101 |
return result
|
|
|
|
| 50 |
max_turns=10
|
| 51 |
)
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
image_data = read_image_file("/home/user/app/coding/ytd_stock_gains.png")
|
| 54 |
markdown_code_png = generate_markdown_image(image_data)
|
| 55 |
|
|
|
|
| 79 |
except Exception as e:
|
| 80 |
print(f"An unexpected error occurred: {e}")
|
| 81 |
|
| 82 |
+
result = markdown_code_png + "\n" + markdown_code_sh + "\n" + markdown_code_py
|
| 83 |
|
| 84 |
+
#print("===")
|
|
|
|
| 85 |
#print(result)
|
| 86 |
+
#print("===")
|
| 87 |
|
| 88 |
return result
|