|
|
@ -97,11 +97,16 @@ class AgentRegistry:
|
|
|
|
agent (Agent): The agent to add.
|
|
|
|
agent (Agent): The agent to add.
|
|
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
Raises:
|
|
|
|
ValueError: If the agent_name already exists in the registry.
|
|
|
|
ValueError: If the agent_name already exists in the registry or is invalid.
|
|
|
|
ValidationError: If the input data is invalid.
|
|
|
|
ValidationError: If the input data is invalid.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
name = agent.agent_name
|
|
|
|
name = agent.agent_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Input validation for agent_name
|
|
|
|
|
|
|
|
if not name or not isinstance(name, str):
|
|
|
|
|
|
|
|
logger.error("Invalid agent name provided.")
|
|
|
|
|
|
|
|
raise ValueError("Invalid agent name provided.")
|
|
|
|
|
|
|
|
|
|
|
|
self.agent_to_py_model(agent)
|
|
|
|
self.agent_to_py_model(agent)
|
|
|
|
|
|
|
|
|
|
|
|
with self.lock:
|
|
|
|
with self.lock:
|
|
|
|