Integrations: protocol and discovery¶
The integration protocol and entry-point discovery, for authors of new integrations (Writing an integration).
agent_adapter.integrations.base¶
The integration protocol: what every framework bridge provides, and a helper base class.
MODEL_VISIBLE_ERRORS = (ToolArgsInvalid, ToolError, ApprovalDenied, GuardrailBlocked, RunLimitExceeded)
module-attribute
¶
FlowCompiler
¶
Bases: Protocol
An integration that also compiles flows; flow is a FlowSpec (typed Any here).
Integration
¶
Bases: Protocol
A framework bridge; name is the canonical target name and the entry-point name.
The attributes are read-only properties here so that class attributes satisfy them.
IntegrationBase
¶
Bases: ABC
Helper base for built-in and third-party integrations; subclasses add export_tool.
bind_approval(port)
¶
None: the executor's approval port decides.
bind_context(native)
¶
A context holding native in extras[name] and its call id in call_id.
export_tool(spec, *, executor=None)
abstractmethod
¶
The framework's native tool object for spec.
export_tools(registry, *, executor=None)
¶
Native tools for every registry tool exported to this integration's target.
require()
¶
Raise MissingDependency naming the extra when a required module is missing.
ToolRunner
¶
Bases: Protocol
Runs one tool call through the full policy pipeline (an Executor is one).
model_visible_error(exc)
¶
{"error": {"kind", "message"}} for a tool result; foreign errors show only their type.
agent_adapter.integrations.discovery¶
Find integrations through the agent_adapter.integrations entry-point group.
GROUP = 'agent_adapter.integrations'
module-attribute
¶
available_integrations(*, refresh=False)
¶
Every integration that loads and conforms, by name; cached until refresh=True.
Concurrent calls share one discovery. Raises IntegrationError when called by a plugin while it is being discovered.
get_integration(name)
¶
The integration registered as name, with its required modules importable.
Raises:
| Type | Description |
|---|---|
IntegrationError
|
no integration has that name, or called during discovery. |
MissingDependency
|
a module it requires is not installed. |