mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 23:48:04 +08:00
feat: get debugging key
This commit is contained in:
@ -10,7 +10,7 @@ from configs import dify_config
|
||||
from core.plugin.entities.plugin_daemon import PluginDaemonBasicResponse
|
||||
|
||||
plugin_daemon_inner_api_baseurl = dify_config.PLUGIN_API_URL
|
||||
plugin_daemon_inner_api_key = dify_config.INNER_API_KEY_FOR_PLUGIN
|
||||
plugin_daemon_inner_api_key = dify_config.PLUGIN_API_KEY
|
||||
|
||||
T = TypeVar("T", bound=(BaseModel | dict))
|
||||
|
||||
@ -69,9 +69,9 @@ class BasePluginManager:
|
||||
response = self._request(method, path, headers, data)
|
||||
rep = PluginDaemonBasicResponse[type](**response.json())
|
||||
if rep.code != 0:
|
||||
raise Exception(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
||||
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
||||
if rep.data is None:
|
||||
raise Exception("got empty data from plugin daemon")
|
||||
raise ValueError("got empty data from plugin daemon")
|
||||
|
||||
return rep.data
|
||||
|
||||
|
||||
@ -12,6 +12,6 @@ class PluginDebuggingManager(BasePluginManager):
|
||||
class Response(BaseModel):
|
||||
key: str
|
||||
|
||||
response = self._request_with_plugin_daemon_response("POST", f"/plugin/{tenant_id}/debugging/key", Response)
|
||||
response = self._request_with_plugin_daemon_response("POST", f"plugin/{tenant_id}/debugging/key", Response)
|
||||
|
||||
return response.key
|
||||
|
||||
@ -2,4 +2,8 @@ from core.plugin.manager.base import BasePluginManager
|
||||
|
||||
|
||||
class PluginToolManager(BasePluginManager):
|
||||
pass
|
||||
def fetch_tool_providers(self, asset_id: str) -> list[str]:
|
||||
"""
|
||||
Fetch tool providers for the given asset.
|
||||
"""
|
||||
response = self._request('GET', f'/plugin/asset/{asset_id}')
|
||||
Reference in New Issue
Block a user