mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-14 03:38:17 +08:00
13 lines
428 B
Python
13 lines
428 B
Python
from core.plugin.impl.base import BasePluginClient
|
|
|
|
|
|
class PluginAssetManager(BasePluginClient):
|
|
def fetch_asset(self, tenant_id: str, id: str) -> bytes:
|
|
"""
|
|
Fetch an asset by id.
|
|
"""
|
|
response = self._request(method="GET", path=f"plugin/{tenant_id}/asset/{id}")
|
|
if response.status_code != 200:
|
|
raise ValueError(f"can not found asset {id}")
|
|
return response.content
|