mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
feat: enhance sandbox initializers with async and sync support
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
import logging
|
||||
|
||||
from core.app_assets.paths import AssetPaths
|
||||
from core.skill.entities.skill_artifact_set import SkillArtifactSet
|
||||
from extensions.ext_storage import storage
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SkillManager:
|
||||
@staticmethod
|
||||
@ -9,13 +13,14 @@ class SkillManager:
|
||||
tenant_id: str,
|
||||
app_id: str,
|
||||
assets_id: str,
|
||||
) -> SkillArtifactSet | None:
|
||||
) -> SkillArtifactSet:
|
||||
key = AssetPaths.build_skill_artifact_set(tenant_id, app_id, assets_id)
|
||||
try:
|
||||
data = storage.load_once(key)
|
||||
return SkillArtifactSet.model_validate_json(data)
|
||||
except Exception:
|
||||
return None
|
||||
logger.info("Skill artifact set missing or invalid for assets_id=%s", assets_id)
|
||||
return SkillArtifactSet(assets_id=assets_id)
|
||||
|
||||
@staticmethod
|
||||
def save_artifact(
|
||||
|
||||
Reference in New Issue
Block a user