Update agent_registry.py

pull/765/head
nathanogaga118 3 months ago committed by GitHub
parent 4dbd4a6b4f
commit 28e5191fa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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:

Loading…
Cancel
Save