mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: uses to check if the tools are already loaded
This commit is contained in:
parent
56bd0dedfe
commit
5828abcd62
|
@ -148,7 +148,7 @@ class ApiToolProviderController(ToolProviderController):
|
||||||
:param tenant_id: the tenant id
|
:param tenant_id: the tenant id
|
||||||
:return: the tools
|
:return: the tools
|
||||||
"""
|
"""
|
||||||
if self.tools is not None:
|
if len(self.tools) > 0:
|
||||||
return self.tools
|
return self.tools
|
||||||
|
|
||||||
tools: list[ApiTool] = []
|
tools: list[ApiTool] = []
|
||||||
|
|
|
@ -159,7 +159,7 @@ class ApiToolManageService:
|
||||||
# encrypt credentials
|
# encrypt credentials
|
||||||
tool_configuration = ProviderConfigEncrypter(
|
tool_configuration = ProviderConfigEncrypter(
|
||||||
tenant_id=tenant_id,
|
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_type=provider_controller.provider_type.value,
|
||||||
provider_identity=provider_controller.entity.identity.name,
|
provider_identity=provider_controller.entity.identity.name,
|
||||||
)
|
)
|
||||||
|
@ -291,7 +291,7 @@ class ApiToolManageService:
|
||||||
# get original credentials if exists
|
# get original credentials if exists
|
||||||
tool_configuration = ProviderConfigEncrypter(
|
tool_configuration = ProviderConfigEncrypter(
|
||||||
tenant_id=tenant_id,
|
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_type=provider_controller.provider_type.value,
|
||||||
provider_identity=provider_controller.entity.identity.name,
|
provider_identity=provider_controller.entity.identity.name,
|
||||||
)
|
)
|
||||||
|
@ -410,7 +410,7 @@ class ApiToolManageService:
|
||||||
if db_provider.id:
|
if db_provider.id:
|
||||||
tool_configuration = ProviderConfigEncrypter(
|
tool_configuration = ProviderConfigEncrypter(
|
||||||
tenant_id=tenant_id,
|
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_type=provider_controller.provider_type.value,
|
||||||
provider_identity=provider_controller.entity.identity.name,
|
provider_identity=provider_controller.entity.identity.name,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user