mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
fix: allow duplicate tool providers
This commit is contained in:
parent
1907d791e1
commit
9722e6bcb1
|
@ -38,4 +38,4 @@ class PluginTool(Tool):
|
|||
runtime=runtime,
|
||||
tenant_id=self.tenant_id,
|
||||
plugin_unique_identifier=self.plugin_unique_identifier,
|
||||
)
|
||||
)
|
||||
|
|
|
@ -485,7 +485,7 @@ class ToolManager:
|
|||
return cls._builtin_tools_labels[tool_name]
|
||||
|
||||
@classmethod
|
||||
def user_list_providers(
|
||||
def list_providers_from_api(
|
||||
cls, user_id: str, tenant_id: str, typ: ToolProviderTypeApiLiteral
|
||||
) -> list[ToolProviderApiEntity]:
|
||||
result_providers: dict[str, ToolProviderApiEntity] = {}
|
||||
|
@ -526,7 +526,14 @@ class ToolManager:
|
|||
decrypt_credentials=False,
|
||||
)
|
||||
|
||||
result_providers[provider.entity.identity.name] = user_provider
|
||||
if isinstance(provider, PluginToolProviderController):
|
||||
result_providers[f"plugin_provider.{user_provider.name}.{provider.plugin_unique_identifier}"] = (
|
||||
user_provider
|
||||
)
|
||||
else:
|
||||
result_providers[f"builtin_provider.{user_provider.name}"] = (
|
||||
user_provider
|
||||
)
|
||||
|
||||
# get db api providers
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user