Skip to main content

invoker.base

Base invoker class for agent triggers.

InvokerResult Objects

@dataclass
class InvokerResult()

Result returned by an invoker execution.

BaseInvoker Objects

class BaseInvoker(ABC)

Abstract base class for agent trigger invokers.

Subclasses implement invoke to execute the agent's trigger logic and emit lifecycle events (AGENT_STARTED, AGENT_OUTPUT).

Parameters

agent_id : str The runtime agent identifier (used for local agent registry). agent_spec_id : str The agent spec identifier. token : str User JWT token for authenticated API calls. base_url : str Base URL for the AI Agents events API. runtime_base_url : str | None Base URL for the Runtimes API used for runtime termination. Falls back to DATALAYER_RUN_URL when not set. runtime_id : str | None Kubernetes pod name (HOSTNAME). Used as the agent_id when creating events and when terminating the runtime via the platform API. Falls back to agent_id when not set.

invoke

@abstractmethod
async def invoke(trigger_config: dict[str, Any]) -> InvokerResult

Execute the trigger and return the result.

Parameters

trigger_config : dict The trigger block from the agent spec YAML.

Returns

InvokerResult Outcome of the invocation.