diff --git a/crazy_functions/agent_fns/autogen_general.py b/crazy_functions/agent_fns/autogen_general.py
index cf52a56..18c89ab 100644
--- a/crazy_functions/agent_fns/autogen_general.py
+++ b/crazy_functions/agent_fns/autogen_general.py
@@ -41,8 +41,7 @@ class AutoGenGeneral(PluginMultiprocessManager):
'model': self.llm_kwargs['llm_model'],
'api_key': self.llm_kwargs['api_key'],
},]
- autogen_work_dir = get_log_folder('autogen')
- code_execution_config={"work_dir": autogen_work_dir, "use_docker":True}
+ code_execution_config={"work_dir": self.autogen_work_dir, "use_docker":True}
agents = self.define_agents()
user_proxy = None
assistant = None
diff --git a/crazy_functions/agent_fns/pipe.py b/crazy_functions/agent_fns/pipe.py
index df9770a..d28c5cc 100644
--- a/crazy_functions/agent_fns/pipe.py
+++ b/crazy_functions/agent_fns/pipe.py
@@ -1,14 +1,17 @@
-from toolbox import CatchException, update_ui, gen_time_str, trimmed_format_exc, is_the_upload_folder
-import time
+from toolbox import get_log_folder, update_ui, gen_time_str, trimmed_format_exc, promote_file_to_downloadzone
+import time, os
class PipeCom():
def __init__(self, cmd, content) -> None:
self.cmd = cmd
self.content = content
+
class PluginMultiprocessManager():
def __init__(self, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
# ⭐ 主进程
+ self.autogen_work_dir = os.path.join(get_log_folder('autogen'), gen_time_str())
+ self.previous_work_dir_files = {}
self.llm_kwargs = llm_kwargs
self.plugin_kwargs = plugin_kwargs
self.chatbot = chatbot
@@ -42,6 +45,47 @@ class PluginMultiprocessManager():
# ⭐ 主进程
self.parent_conn.send(PipeCom("user_input", cmd))
+ def immediate_showoff_when_possible(self, fp):
+ # ⭐ 主进程
+ # 获取fp的拓展名
+ file_type = fp.split('.')[-1]
+ # 如果是文本文件, 则直接显示文本内容
+ if file_type in ['png', 'jpg']:
+ image_path = os.path.abspath(fp)
+ self.chatbot.append(['检测到新生图像:', f'本地文件预览: