Skip to main content
PluginSet — composable groups of hooks and plugins.

Classes

CLASS PluginSet

A named, composable group of hook functions and plugin instances. PluginSets are inert containers — they do not register anything themselves. Registration happens when they are passed to register() or start_session(plugins=[...]). PluginSets can be nested: a PluginSet can contain other PluginSets. PluginSets also support the context manager protocol for temporary activation:: with PluginSet(“observability”, [log_hook, audit_hook]): result, ctx = instruct(“Summarize this”, ctx, backend)

or async

async with PluginSet(“guards”, [safety_hook]): result, ctx = await ainstruct(“Generate code”, ctx, backend)
Methods:

FUNC flatten

flatten(self) -> list[tuple[Callable | Any, int | None]]
Recursively flatten nested PluginSets into (item, priority_override) pairs. When this set has a priority, it overrides the priorities of all nested items — including items inside nested PluginSet instances.