mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-10 12:42:34 +00:00
feat(Agent): ChatAgent And AgentHub
1.Upgrade sqlalchemy to version 2.0
This commit is contained in:
parent
806612ad7d
commit
93e304732a
@ -69,8 +69,10 @@ async def agent_hub_update(update_param: PluginHubParam = Body()):
|
|||||||
logger.info(f"agent_hub_update:{update_param.__dict__}")
|
logger.info(f"agent_hub_update:{update_param.__dict__}")
|
||||||
try:
|
try:
|
||||||
agent_hub = AgentHub(PLUGINS_DIR)
|
agent_hub = AgentHub(PLUGINS_DIR)
|
||||||
|
branch = update_param.branch if update_param.branch is not None and len(update_param.branch) > 0 else "main"
|
||||||
|
authorization = update_param.authorization if update_param.branch is not None and len(update_param.branch) > 0 else None
|
||||||
agent_hub.refresh_hub_from_git(
|
agent_hub.refresh_hub_from_git(
|
||||||
update_param.url, update_param.branch, update_param.authorization
|
update_param.url, branch, authorization
|
||||||
)
|
)
|
||||||
return Result.succ(None)
|
return Result.succ(None)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -125,7 +125,7 @@ class AgentHub:
|
|||||||
my_plugin_entity.version = hub_plugin.version
|
my_plugin_entity.version = hub_plugin.version
|
||||||
return my_plugin_entity
|
return my_plugin_entity
|
||||||
|
|
||||||
def refresh_hub_from_git(self, github_repo: str = None, branch_name: str = None, authorization: str = None):
|
def refresh_hub_from_git(self, github_repo: str = None, branch_name: str = "main", authorization: str = None):
|
||||||
logger.info("refresh_hub_by_git start!")
|
logger.info("refresh_hub_by_git start!")
|
||||||
update_from_git(self.temp_hub_file_path, github_repo, branch_name, authorization)
|
update_from_git(self.temp_hub_file_path, github_repo, branch_name, authorization)
|
||||||
git_plugins = scan_plugins(self.temp_hub_file_path)
|
git_plugins = scan_plugins(self.temp_hub_file_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user