feat(tasks): add skill-templated task graph execution
This commit is contained in:
@ -83,6 +83,12 @@ class SkillAssembler:
|
||||
return SkillAssemblyResult()
|
||||
llm_interactions: list[dict[str, Any]] = []
|
||||
|
||||
if len(candidates) == 1:
|
||||
return SkillAssemblyResult(
|
||||
activated_skills=self._activate_skill_contexts([candidates[0]["name"]]),
|
||||
llm_interactions=llm_interactions,
|
||||
)
|
||||
|
||||
if len(candidates) <= self.max_detailed_candidates:
|
||||
shortlisted_names = [item["name"] for item in candidates]
|
||||
else:
|
||||
@ -115,6 +121,10 @@ class SkillAssembler:
|
||||
if not selected_names:
|
||||
return SkillAssemblyResult(llm_interactions=llm_interactions)
|
||||
|
||||
activated_skills = self._activate_skill_contexts(selected_names)
|
||||
return SkillAssemblyResult(activated_skills=activated_skills, llm_interactions=llm_interactions)
|
||||
|
||||
def _activate_skill_contexts(self, selected_names: list[str]) -> list[SkillContext]:
|
||||
activated_skills: list[SkillContext] = []
|
||||
for name in selected_names:
|
||||
record = self.loader.get_skill_record(name)
|
||||
@ -130,10 +140,11 @@ class SkillAssembler:
|
||||
content_hash=record.content_hash or "" if record is not None else "",
|
||||
activation_reason="llm_selected",
|
||||
tool_hints=list(record.tool_hints) if record is not None else [],
|
||||
team_template=getattr(record, "team_template", None) if record is not None else None,
|
||||
team_template_warnings=list(getattr(record, "team_template_warnings", [])) if record is not None else [],
|
||||
)
|
||||
)
|
||||
|
||||
return SkillAssemblyResult(activated_skills=activated_skills, llm_interactions=llm_interactions)
|
||||
return activated_skills
|
||||
|
||||
async def _select_skill_names(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user