feat(Agent): ChatAgent And AgentHub

1.Upgrade sqlalchemy to version 2.0
This commit is contained in:
yhjun1026 2023-10-17 18:58:36 +08:00
parent 806612ad7d
commit 93e304732a
2 changed files with 4 additions and 2 deletions

View File

@ -69,8 +69,10 @@ async def agent_hub_update(update_param: PluginHubParam = Body()):
logger.info(f"agent_hub_update:{update_param.__dict__}")
try:
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(
update_param.url, update_param.branch, update_param.authorization
update_param.url, branch, authorization
)
return Result.succ(None)
except Exception as e:

View File

@ -125,7 +125,7 @@ class AgentHub:
my_plugin_entity.version = hub_plugin.version
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!")
update_from_git(self.temp_hub_file_path, github_repo, branch_name, authorization)
git_plugins = scan_plugins(self.temp_hub_file_path)