Add more docs and validate tool configs

This commit is contained in:
akhisud3195 2025-01-30 15:50:03 +05:30
parent ecc470d5a3
commit 6e59de77aa
7 changed files with 166 additions and 7 deletions

View file

@ -228,6 +228,13 @@ def check_request_validity(messages, agent_configs, tool_configs, prompt_configs
missing_keys = [key for key in ["name", "instructions", "tools", "model"] if key not in agent_config]
error_msg = f"Invalid agent config - missing keys: {missing_keys}"
error_type = ErrorType.FATAL.value
# All tool configs should have: name, parameters --> Fatal
for tool_config in tool_configs:
if not all(key in tool_config for key in ["name", "parameters"]):
missing_keys = [key for key in ["name", "parameters"] if key not in tool_config]
error_msg = f"Invalid tool config - missing keys: {missing_keys}"
error_type = ErrorType.FATAL.value
# Check for cycles in the agent config graph. Raise error if cycle is found, along with the agents involved in the cycle.
def find_cycles(agent_name, agent_configs, visited=None, path=None):