haive.core.engine.agent.registry

Agent registry module for managing and resolving agent classes.

from typing import Any This module provides a registry for associating agent configurations with their implementing classes, allowing dynamic discovery and resolution.

Functions

register_agent(config_class)

Register an agent class with its configuration class.

register_agents_from_module(module_path)

Register all agents from a module.

resolve_agent_class(config_class)

Resolve an agent class for a given config class.

Module Contents

haive.core.engine.agent.registry.register_agent(config_class)[source]

Register an agent class with its configuration class.

Parameters:

config_class (type) – The agent config class to register

Returns:

A decorator function that registers the agent class

haive.core.engine.agent.registry.register_agents_from_module(module_path)[source]

Register all agents from a module.

Parameters:

module_path (str) – The module path to scan for agents

Returns:

Number of agents registered

Return type:

int

haive.core.engine.agent.registry.resolve_agent_class(config_class)[source]

Resolve an agent class for a given config class.

First checks the registry, then tries to resolve by naming convention, looking in the same module or sibling modules.

Parameters:

config_class (type) – The agent config class to find an implementation for

Returns:

The agent class if found, None otherwise

Return type:

type | None