diff --git a/pilot/base_modules/agent/controller.py b/pilot/base_modules/agent/controller.py index dad4c1f74..4bca3dee8 100644 --- a/pilot/base_modules/agent/controller.py +++ b/pilot/base_modules/agent/controller.py @@ -136,7 +136,7 @@ async def personal_agent_upload( doc_file: UploadFile = File(...), user: str =No logger.info(f"personal_agent_upload:{doc_file.filename},{user}") try: agent_hub = AgentHub(PLUGINS_DIR) - agent_hub.upload_my_plugin(doc_file, user) + await agent_hub.upload_my_plugin(doc_file, user) return Result.succ(None) except Exception as e: logger.error("Upload Personal Plugin Error!", e) diff --git a/pilot/base_modules/agent/db/my_plugin_db.py b/pilot/base_modules/agent/db/my_plugin_db.py index 3958b757d..8661d6f70 100644 --- a/pilot/base_modules/agent/db/my_plugin_db.py +++ b/pilot/base_modules/agent/db/my_plugin_db.py @@ -15,7 +15,7 @@ class MyPluginEntity(Base): id = Column(Integer, primary_key=True, comment="autoincrement id") tenant = Column(String(255), nullable=True, comment="user's tenant") - user_code = Column(String(255), nullable=True, comment="user code") + user_code = Column(String(255), nullable=False, comment="user code") user_name = Column(String(255), nullable=True, comment="user name") name = Column(String(255), unique=True, nullable=False, comment="plugin name") file_name = Column(String(255), nullable=False, comment="plugin package file name") @@ -25,7 +25,7 @@ class MyPluginEntity(Base): succ_count = Column(Integer, nullable=True, default=0, comment="plugin total success count") created_at = Column(DateTime, default=datetime.utcnow, comment="plugin install time") __table_args__ = ( - UniqueConstraint('name', name="uk_name"), + UniqueConstraint('user_code','name', name="uk_name"), ) diff --git a/pilot/base_modules/agent/hub/agent_hub.py b/pilot/base_modules/agent/hub/agent_hub.py index 33469feb0..b61158a40 100644 --- a/pilot/base_modules/agent/hub/agent_hub.py +++ b/pilot/base_modules/agent/hub/agent_hub.py @@ -140,7 +140,7 @@ class AgentHub: except Exception as e: raise ValueError(f"Update Agent Hub Db Info Faild!{str(e)}") - def upload_my_plugin(self, doc_file: UploadFile, user: Any=Default_User): + async def upload_my_plugin(self, doc_file: UploadFile, user: Any=Default_User): # We can not move temp file in windows system when we open file in context of `with` file_path = os.path.join(self.plugin_dir, doc_file.filename) @@ -150,13 +150,17 @@ class AgentHub: dir=os.path.join(self.plugin_dir) ) with os.fdopen(tmp_fd, "wb") as tmp: - tmp.write(doc_file.read()) + tmp.write(await doc_file.read()) shutil.move( tmp_path, os.path.join(self.plugin_dir, doc_file.filename), ) my_plugins = scan_plugins(self.plugin_dir, doc_file.filename) + + if user is None or len(user) <=0: + user = Default_User + for my_plugin in my_plugins: my_plugin_entiy = MyPluginEntity() diff --git a/pilot/server/dbgpt_server.py b/pilot/server/dbgpt_server.py index 591ac39af..71ef9f8d8 100644 --- a/pilot/server/dbgpt_server.py +++ b/pilot/server/dbgpt_server.py @@ -41,7 +41,6 @@ from pilot.utils.utils import ( from pilot.utils.tracer import root_tracer, initialize_tracer, SpanType, SpanTypeRunName from pilot.utils.parameter_utils import _get_dict_from_obj from pilot.utils.system_utils import get_system_info - from pilot.base_modules.agent.controller import router as agent_route diff --git a/pilot/server/static/models/baichuan.png b/pilot/server/static/models/baichuan.png new file mode 100644 index 000000000..cd5311bb7 Binary files /dev/null and b/pilot/server/static/models/baichuan.png differ diff --git a/pilot/server/static/models/bard.gif b/pilot/server/static/models/bard.gif new file mode 100644 index 000000000..78de37340 Binary files /dev/null and b/pilot/server/static/models/bard.gif differ diff --git a/pilot/server/static/models/chatglm.png b/pilot/server/static/models/chatglm.png new file mode 100644 index 000000000..83056df99 Binary files /dev/null and b/pilot/server/static/models/chatglm.png differ diff --git a/pilot/server/static/models/chatgpt.png b/pilot/server/static/models/chatgpt.png new file mode 100644 index 000000000..1d58d6ef9 Binary files /dev/null and b/pilot/server/static/models/chatgpt.png differ diff --git a/pilot/server/static/models/claude.png b/pilot/server/static/models/claude.png new file mode 100644 index 000000000..6c725b6b7 Binary files /dev/null and b/pilot/server/static/models/claude.png differ diff --git a/pilot/server/static/models/falcon.jpeg b/pilot/server/static/models/falcon.jpeg new file mode 100644 index 000000000..10527f9db Binary files /dev/null and b/pilot/server/static/models/falcon.jpeg differ diff --git a/pilot/server/static/models/google.png b/pilot/server/static/models/google.png new file mode 100644 index 000000000..1b0a85644 Binary files /dev/null and b/pilot/server/static/models/google.png differ diff --git a/pilot/server/static/models/gorilla.png b/pilot/server/static/models/gorilla.png new file mode 100644 index 000000000..0f30fad74 Binary files /dev/null and b/pilot/server/static/models/gorilla.png differ diff --git a/pilot/server/static/models/huggingface.svg b/pilot/server/static/models/huggingface.svg new file mode 100644 index 000000000..43c5d3c0c --- /dev/null +++ b/pilot/server/static/models/huggingface.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/pilot/server/static/models/index.html b/pilot/server/static/models/index.html new file mode 100644 index 000000000..73e27db9d --- /dev/null +++ b/pilot/server/static/models/index.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/pilot/server/static/models/internlm.png b/pilot/server/static/models/internlm.png new file mode 100644 index 000000000..97e952ae6 Binary files /dev/null and b/pilot/server/static/models/internlm.png differ diff --git a/pilot/server/static/models/llama.jpg b/pilot/server/static/models/llama.jpg new file mode 100644 index 000000000..22db2a26b Binary files /dev/null and b/pilot/server/static/models/llama.jpg differ diff --git a/pilot/server/static/models/qwen2.png b/pilot/server/static/models/qwen2.png new file mode 100644 index 000000000..540b437a1 Binary files /dev/null and b/pilot/server/static/models/qwen2.png differ diff --git a/pilot/server/static/models/salesforce.jpeg b/pilot/server/static/models/salesforce.jpeg new file mode 100644 index 000000000..b43edf4eb Binary files /dev/null and b/pilot/server/static/models/salesforce.jpeg differ diff --git a/pilot/server/static/models/vicuna.jpeg b/pilot/server/static/models/vicuna.jpeg new file mode 100644 index 000000000..9783235fa Binary files /dev/null and b/pilot/server/static/models/vicuna.jpeg differ diff --git a/pilot/server/static/models/wizardlm.png b/pilot/server/static/models/wizardlm.png new file mode 100644 index 000000000..206ad6e87 Binary files /dev/null and b/pilot/server/static/models/wizardlm.png differ diff --git a/pilot/server/static/models/zhipu.png b/pilot/server/static/models/zhipu.png new file mode 100644 index 000000000..30d4ce225 Binary files /dev/null and b/pilot/server/static/models/zhipu.png differ