Class swarmauri_core.swarm_apis.IAgentRegistrationAPI.IAgentRegistrationAPI
swarmauri_core.swarm_apis.IAgentRegistrationAPI.IAgentRegistrationAPI
Bases: ABC
Interface for registering agents with the swarm, designed to support CRUD operations on IAgent instances.
register_agent
abstractmethod
register_agent(agent)
Register a new agent with the swarm.
| PARAMETER | DESCRIPTION |
|---|---|
agent
|
An instance of IAgent representing the agent to register.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the registration succeeded; False otherwise.
TYPE:
|
Source code in swarmauri_core/swarm_apis/IAgentRegistrationAPI.py
11 12 13 14 15 16 17 18 19 20 21 22 | |
update_agent
abstractmethod
update_agent(agent_id, updated_agent)
Update the details of an existing agent. This could include changing the agent's configuration, task assignment, or any other mutable attribute.
| PARAMETER | DESCRIPTION |
|---|---|
agent_id
|
The unique identifier for the agent.
TYPE:
|
updated_agent
|
An updated IAgent instance to replace the existing one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the update was successful; False otherwise.
TYPE:
|
Source code in swarmauri_core/swarm_apis/IAgentRegistrationAPI.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
remove_agent
abstractmethod
remove_agent(agent_id)
Remove an agent from the swarm based on its unique identifier.
| PARAMETER | DESCRIPTION |
|---|---|
agent_id
|
The unique identifier for the agent to be removed.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the removal was successful; False otherwise.
TYPE:
|
Source code in swarmauri_core/swarm_apis/IAgentRegistrationAPI.py
39 40 41 42 43 44 45 46 47 48 49 50 | |
get_agent
abstractmethod
get_agent(agent_id)
Retrieve an agent's instance from its unique identifier.
| PARAMETER | DESCRIPTION |
|---|---|
agent_id
|
The unique identifier for the agent of interest.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Optional[IAgent]
|
Optional[IAgent]: The IAgent instance if found; None otherwise. |
Source code in swarmauri_core/swarm_apis/IAgentRegistrationAPI.py
52 53 54 55 56 57 58 59 60 61 62 63 | |
list_agents
abstractmethod
list_agents()
List all registered agents.
| RETURNS | DESCRIPTION |
|---|---|
List[IAgent]
|
List[IAgent]: A list containing instances of all registered IAgents. |
Source code in swarmauri_core/swarm_apis/IAgentRegistrationAPI.py
65 66 67 68 69 70 71 72 73 | |