Skip to content

antikythera_agents.decorators ¤

Functions¤

agent ¤

agent(type: str)

Decorator to register an agent class with a specific type.

Parameters:

  • type (str) –

    The agent type identifier (e.g., "system", "user_interaction")

Examples:

>>> @agent(type="system")
... class SystemAgent(Agent):
...     pass

get_agent_class ¤

get_agent_class(agent_type: str) -> type | None

Get the agent class for a given type.

Parameters:

  • agent_type (str) –

    The agent type identifier

Returns:

  • type or None

    The agent class if found, None otherwise

get_agent_tools ¤

get_agent_tools(agent_class: type) -> dict[str, Callable]

Get all tools for a given agent class.

Parameters:

  • agent_class (type) –

    The agent class to scan for tools

Returns:

  • dict

    Dictionary mapping tool names to their methods

list_registered_agents ¤

list_registered_agents() -> dict[str, type]

List all registered agent types and their classes.

Returns:

  • dict

    Dictionary mapping agent type strings to their classes

tool ¤

tool(name: str | None = None)

Decorator to mark a method as a tool within an agent.

Parameters:

  • name (str, default: None ) –

    Optional tool name. If not provided, uses the method name.

Examples:

>>> @tool(name="start_process")
... def start(self, task: Task) -> dict:
...     return {"result": "started"}