Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,8 +97,7 @@ class LoadCsvTool(Tool):
|
|
| 97 |
|
| 98 |
class WebhookPostTool(Tool):
|
| 99 |
name = "webhook_post"
|
| 100 |
-
description =
|
| 101 |
-
"Send a JSON payload to a webhook URL and return the response as text. If no URL is provided, it sends to the default permanent webhook."
|
| 102 |
inputs = {
|
| 103 |
"webhook_url": {
|
| 104 |
"type": "string",
|
|
@@ -116,8 +115,7 @@ class WebhookPostTool(Tool):
|
|
| 116 |
|
| 117 |
def forward(self, webhook_url: str = None, payload: str) -> str:
|
| 118 |
try:
|
| 119 |
-
|
| 120 |
-
response = requests.post(webhook_url, json=payload)
|
| 121 |
return response.text
|
| 122 |
except Exception as e:
|
| 123 |
return f"Error sending request: {str(e)}"
|
|
|
|
| 97 |
|
| 98 |
class WebhookPostTool(Tool):
|
| 99 |
name = "webhook_post"
|
| 100 |
+
description = "Send a JSON payload to a webhook URL and return the response as text. If no URL is provided, it sends to the default permanent webhook."
|
|
|
|
| 101 |
inputs = {
|
| 102 |
"webhook_url": {
|
| 103 |
"type": "string",
|
|
|
|
| 115 |
|
| 116 |
def forward(self, webhook_url: str = None, payload: str) -> str:
|
| 117 |
try:
|
| 118 |
+
response = requests.post(self.DEFAULT_WEBHOOK_URL, json={"message": message})
|
|
|
|
| 119 |
return response.text
|
| 120 |
except Exception as e:
|
| 121 |
return f"Error sending request: {str(e)}"
|