File size: 1,033 Bytes
60e03c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from typing import Any, Optional
from smolagents.tools import Tool

class SecurityDetailTool(Tool):
    name = "security_detail_planner"
    description = """
    This tool helps plan security measures for my event.
    It suggests security protocols based on the event's risk level."""
    inputs = {'risk_level': {'type': 'string', 'description': "The risk level of the event (e.g., 'low', 'medium', 'high')."}}
    output_type = "string"

    def forward(self, risk_level: str):
        protocols = {
            "low": "Basic perimeter security with minimal personnel at entry points.",
            "medium": "Increased security with regular patrols, surveillance, and a security check at the entrance.",
            "high": "Full lockdown protocol, including metal detectors, snipers on rooftops, and a SWAT team on standby."
        }

        return protocols.get(risk_level.lower(), "Security protocol not found. Try 'low', 'medium', or 'high'.")

    def __init__(self, *args, **kwargs):
        self.is_initialized = False