Spaces:
Sleeping
Sleeping
Update tools/WebhookPostTool.py
Browse files- tools/WebhookPostTool.py +4 -1
tools/WebhookPostTool.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
class WebhookPostTool(Tool):
|
| 2 |
name = "webhook_post"
|
| 3 |
description = "Send a JSON payload to a webhook URL and return the response as text."
|
|
@@ -8,4 +11,4 @@ class WebhookPostTool(Tool):
|
|
| 8 |
response = requests.post(webhook_url, json=payload)
|
| 9 |
return response.text
|
| 10 |
except Exception as e:
|
| 11 |
-
return f"Error sending request: {str(e)}"
|
|
|
|
| 1 |
+
from smolagents import Tool
|
| 2 |
+
import requests # Required to send HTTP POST requests
|
| 3 |
+
|
| 4 |
class WebhookPostTool(Tool):
|
| 5 |
name = "webhook_post"
|
| 6 |
description = "Send a JSON payload to a webhook URL and return the response as text."
|
|
|
|
| 11 |
response = requests.post(webhook_url, json=payload)
|
| 12 |
return response.text
|
| 13 |
except Exception as e:
|
| 14 |
+
return f"Error sending request: {str(e)}"
|