Skip to content

SkillsTool

autogen.beta.tools.builtin.skills.SkillsTool #

SkillsTool(*skills)

Bases: Tool

Declares provider-side skills to be activated for this agent.

Accepts skill identifiers as plain strings (shorthand for the latest version) or :class:Skill objects when a specific version is required.

Example::

# Strings — shorthand for Skill(id=s, version=None)
SkillsTool("pptx", "xlsx")

# Mix
SkillsTool("pptx", Skill("xlsx", version="latest"))
Source code in autogen/beta/tools/builtin/skills.py
def __init__(self, *skills: str | Skill) -> None:
    self._skills: list[Skill] = [s if isinstance(s, Skill) else Skill(id=s) for s in skills]

schemas async #

schemas(context)
Source code in autogen/beta/tools/builtin/skills.py
async def schemas(self, context: "Context") -> list[SkillsToolSchema]:
    return [SkillsToolSchema(skills=list(self._skills))]

register #

register(stack, context, *, middleware=())
Source code in autogen/beta/tools/builtin/skills.py
def register(
    self,
    stack: "ExitStack",
    context: "Context",
    *,
    middleware: Iterable["BaseMiddleware"] = (),
) -> None:
    pass