ChrisSacrumCor commited on
Commit
8cfefd7
·
verified ·
1 Parent(s): 75940c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -37
app.py CHANGED
@@ -1375,47 +1375,28 @@ module "{module_name}" {{
1375
  return f"❌ Unknown Terraform tool: {tool_name}. Available: generate_terraform_config, validate_terraform_config, get_deployment_workflow, convert_to_module, format_terraform_code, generate_terraform_docs"
1376
 
1377
  def select_cisco_tool_and_args(self, user_input: str) -> Dict[str, Any]:
1378
- """Analyze user input to select appropriate Cisco tool and arguments"""
1379
  user_lower = user_input.lower()
1380
 
1381
- # Configuration keywords
1382
- if any(word in user_lower for word in ["config", "configure", "setup", "interface"]):
1383
- if "vlan" in user_lower:
1384
- return {"tool": "configure_vlan", "args": {"vlan_id": 100, "name": "example_vlan"}}
1385
- elif "interface" in user_lower or "port" in user_lower:
1386
- return {"tool": "configure_interface", "args": {"interface": "GigabitEthernet0/1", "config": "access"}}
1387
- elif "ospf" in user_lower:
1388
- return {"tool": "configure_ospf", "args": {"process_id": 1, "network": "192.168.1.0", "area": 0}}
1389
- elif "acl" in user_lower or "access-list" in user_lower:
1390
- return {"tool": "configure_acl", "args": {"acl_name": "EXAMPLE_ACL", "rules": []}}
1391
- else:
1392
- return {"tool": "configure_interface", "args": {"interface": "GigabitEthernet0/1", "config": "basic"}}
1393
-
1394
- # Show commands
1395
- elif any(word in user_lower for word in ["show", "display", "status", "check"]):
1396
- if "interface" in user_lower:
1397
- return {"tool": "show_interface_status", "args": {"interface": "all"}}
1398
- elif "vlan" in user_lower:
1399
- return {"tool": "show_vlan_info", "args": {"vlan_id": "all"}}
1400
- elif "route" in user_lower or "routing" in user_lower:
1401
- return {"tool": "show_routing_table", "args": {}}
1402
- elif "version" in user_lower:
1403
- return {"tool": "show_version", "args": {}}
1404
- else:
1405
- return {"tool": "show_interface_status", "args": {"interface": "all"}}
1406
 
1407
- # Troubleshooting keywords
1408
- elif any(word in user_lower for word in ["troubleshoot", "debug", "problem", "issue", "ping", "trace"]):
1409
- if "connectivity" in user_lower or "ping" in user_lower:
1410
- return {"tool": "ping_test", "args": {"target": "8.8.8.8", "count": 4}}
1411
- elif "trace" in user_lower:
1412
- return {"tool": "traceroute", "args": {"target": "8.8.8.8"}}
1413
- else:
1414
- return {"tool": "troubleshoot_interface", "args": {"interface": "GigabitEthernet0/1"}}
1415
 
1416
- # Backup keywords
1417
- elif any(word in user_lower for word in ["backup", "save", "copy"]):
1418
- return {"tool": "backup_config", "args": {"destination": "tftp://192.168.1.10/backup.cfg"}}
 
 
 
 
1419
 
1420
  # Default - show help
1421
  else:
 
1375
  return f"❌ Unknown Terraform tool: {tool_name}. Available: generate_terraform_config, validate_terraform_config, get_deployment_workflow, convert_to_module, format_terraform_code, generate_terraform_docs"
1376
 
1377
  def select_cisco_tool_and_args(self, user_input: str) -> Dict[str, Any]:
1378
+ """Analyze user input to select appropriate Cisco tool and arguments - using ACTUAL tool names"""
1379
  user_lower = user_input.lower()
1380
 
1381
+ # VLAN management keywords
1382
+ if any(word in user_lower for word in ["vlan", "vlan management", "create vlan", "vlan config"]):
1383
+ return {"tool": "vlan_management", "args": {"operation": "create", "vlan_id": 100, "name": "example_vlan"}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1384
 
1385
+ # Interface configuration keywords
1386
+ elif any(word in user_lower for word in ["interface", "port", "configure interface", "interface config"]):
1387
+ return {"tool": "interface_configuration", "args": {"interface": "GigabitEthernet0/1", "operation": "configure"}}
1388
+
1389
+ # Routing configuration keywords
1390
+ elif any(word in user_lower for word in ["routing", "ospf", "bgp", "route", "routing config"]):
1391
+ return {"tool": "routing_configuration", "args": {"protocol": "ospf", "operation": "configure"}}
 
1392
 
1393
+ # Security configuration keywords
1394
+ elif any(word in user_lower for word in ["security", "acl", "access-list", "firewall", "security config"]):
1395
+ return {"tool": "security_configuration", "args": {"type": "acl", "operation": "create"}}
1396
+
1397
+ # Troubleshooting keywords
1398
+ elif any(word in user_lower for word in ["troubleshoot", "debug", "problem", "issue", "ping", "trace", "show", "status"]):
1399
+ return {"tool": "troubleshooting", "args": {"operation": "ping", "target": "8.8.8.8"}}
1400
 
1401
  # Default - show help
1402
  else: