mirror of
https://github.com/langgenius/dify.git
synced 2026-02-22 19:15:47 +08:00
feat: endpoint management
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
from collections.abc import Generator
|
||||
|
||||
from core.plugin.entities.plugin import PluginEntity
|
||||
from core.plugin.entities.plugin_daemon import InstallPluginMessage
|
||||
from core.plugin.manager.base import BasePluginManager
|
||||
|
||||
@ -12,6 +13,14 @@ class PluginInstallationManager(BasePluginManager):
|
||||
"GET", f"plugin/{tenant_id}/fetch/identifier", bool, params={"plugin_unique_identifier": identifier}
|
||||
)
|
||||
|
||||
def list_plugins(self, tenant_id: str) -> list[PluginEntity]:
|
||||
return self._request_with_plugin_daemon_response(
|
||||
"GET",
|
||||
f"plugin/{tenant_id}/management/list",
|
||||
list[PluginEntity],
|
||||
params={"page": 1, "page_size": 256},
|
||||
)
|
||||
|
||||
def install_from_pkg(self, tenant_id: str, pkg: bytes) -> Generator[InstallPluginMessage, None, None]:
|
||||
"""
|
||||
Install a plugin from a package.
|
||||
|
||||
Reference in New Issue
Block a user