mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-01 08:11:45 +00:00
feat(Agent): ChatAgent And AgentHub
1.Upgrade sqlalchemy to version 2.0
This commit is contained in:
parent
65c745495b
commit
708557c70f
@ -156,6 +156,7 @@ async def personal_agent_upload(doc_file: UploadFile = File(...), user: str = No
|
||||
try:
|
||||
agent_hub = AgentHub(PLUGINS_DIR)
|
||||
await agent_hub.upload_my_plugin(doc_file, user)
|
||||
module_agent.refresh_plugins()
|
||||
return Result.succ(None)
|
||||
except Exception as e:
|
||||
logger.error("Upload Personal Plugin Error!", e)
|
||||
|
@ -180,7 +180,7 @@ class AgentHub:
|
||||
os.remove(file_path)
|
||||
tmp_fd, tmp_path = tempfile.mkstemp(dir=os.path.join(self.plugin_dir))
|
||||
with os.fdopen(tmp_fd, "wb") as tmp:
|
||||
await tmp.write(await doc_file.read())
|
||||
tmp.write(await doc_file.read())
|
||||
shutil.move(
|
||||
tmp_path,
|
||||
os.path.join(self.plugin_dir, doc_file.filename),
|
||||
|
Loading…
Reference in New Issue
Block a user