mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
refactor(skill): transition from artifact set to bundle structure
- Replaced SkillArtifactSet with SkillBundle across various components, enhancing the organization of skill dependencies and references. - Updated SkillManager methods to load and save bundles instead of artifacts, improving clarity in asset management. - Refactored SkillCompiler to compile skills into bundles, streamlining the dependency resolution process. - Adjusted DifyCli and SandboxBashSession to utilize ToolDependencies, ensuring consistent handling of tool references. - Introduced AssetReferences for better management of file dependencies within skill bundles.
This commit is contained in:
@ -24,13 +24,20 @@ class SkillInitializer(SyncSandboxInitializer):
|
||||
self._user_id = user_id
|
||||
self._assets_id = assets_id
|
||||
|
||||
def initialize(self, env: Sandbox) -> None:
|
||||
artifact_set = SkillManager.load_artifact(
|
||||
def initialize(self, sandbox: Sandbox) -> None:
|
||||
bundle = SkillManager.load_bundle(
|
||||
self._tenant_id,
|
||||
self._app_id,
|
||||
self._assets_id,
|
||||
)
|
||||
env.attrs.set(
|
||||
SkillAttrs.ARTIFACT_SET,
|
||||
artifact_set,
|
||||
if bundle is None:
|
||||
raise ValueError(
|
||||
f"No skill bundle found for tenant_id={self._tenant_id}, "
|
||||
f"app_id={self._app_id}, "
|
||||
f"assets_id={self._assets_id}"
|
||||
)
|
||||
|
||||
sandbox.attrs.set(
|
||||
SkillAttrs.BUNDLE,
|
||||
bundle,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user