diff --git a/api/core/tools/custom_tool/provider.py b/api/core/tools/custom_tool/provider.py index 3acdd23f4e..9c9f26b60a 100644 --- a/api/core/tools/custom_tool/provider.py +++ b/api/core/tools/custom_tool/provider.py @@ -148,7 +148,7 @@ class ApiToolProviderController(ToolProviderController): :param tenant_id: the tenant id :return: the tools """ - if self.tools is not None: + if len(self.tools) > 0: return self.tools tools: list[ApiTool] = [] diff --git a/api/services/tools/api_tools_manage_service.py b/api/services/tools/api_tools_manage_service.py index e7903fc4eb..493371a627 100644 --- a/api/services/tools/api_tools_manage_service.py +++ b/api/services/tools/api_tools_manage_service.py @@ -159,7 +159,7 @@ class ApiToolManageService: # encrypt credentials tool_configuration = ProviderConfigEncrypter( tenant_id=tenant_id, - config=provider_controller.get_credentials_schema(), + config=list(provider_controller.get_credentials_schema()), provider_type=provider_controller.provider_type.value, provider_identity=provider_controller.entity.identity.name, ) @@ -291,7 +291,7 @@ class ApiToolManageService: # get original credentials if exists tool_configuration = ProviderConfigEncrypter( tenant_id=tenant_id, - config=provider_controller.get_credentials_schema(), + config=list(provider_controller.get_credentials_schema()), provider_type=provider_controller.provider_type.value, provider_identity=provider_controller.entity.identity.name, ) @@ -410,7 +410,7 @@ class ApiToolManageService: if db_provider.id: tool_configuration = ProviderConfigEncrypter( tenant_id=tenant_id, - config=provider_controller.get_credentials_schema(), + config=list(provider_controller.get_credentials_schema()), provider_type=provider_controller.provider_type.value, provider_identity=provider_controller.entity.identity.name, )