Isaac454/First_agent_template3
0
1from smolagents import Tool2import requests # Required to send HTTP POST requests3 4class WebhookPostTool(Tool):5 name = "webhook_post"6 description = "Send a JSON payload to a webhook URL and return the response as text."7 output_type = str # Must be one of SmolAgents authorized types8 9 def forward(self, webhook_url: str, payload: dict) -> str:10 try:11 response = requests.post(webhook_url, json=payload)12 return response.text13 except Exception as e:14 return f"Error sending request: {str(e)}"15 