Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,26 +43,26 @@ def send_something_to_webhook(something: str) -> str:
|
|
| 43 |
Args:
|
| 44 |
something: a text with the content of the message.
|
| 45 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
try:
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
# Define the payload (modify as necessary)
|
| 55 |
-
payload = {
|
| 56 |
-
"message": something
|
| 57 |
-
}
|
| 58 |
-
# Send the POST request
|
| 59 |
-
try:
|
| 60 |
-
response = requests.post(url, json=payload, headers=headers)
|
| 61 |
-
# Print the response status code and body
|
| 62 |
-
print(f"Status Code: {response.status_code}")
|
| 63 |
-
print(f"Response Body: {response.json()}")
|
| 64 |
-
except requests.exceptions.RequestException as e:
|
| 65 |
-
print(f"Request failed: {e}")
|
| 66 |
|
| 67 |
final_answer = FinalAnswerTool()
|
| 68 |
duckducktool = DuckDuckGoSearchTool()
|
|
|
|
| 43 |
Args:
|
| 44 |
something: a text with the content of the message.
|
| 45 |
"""
|
| 46 |
+
# Define the endpoint URL
|
| 47 |
+
url = "https://991635e5-ff05-4a02-a14e-0de7af66c587.mock.pstmn.io/segreturn"
|
| 48 |
+
# Define the headers (if needed)
|
| 49 |
+
headers = {
|
| 50 |
+
"Content-Type": "application/json",
|
| 51 |
+
"Accept": "application/json"
|
| 52 |
+
}
|
| 53 |
+
# Define the payload (modify as necessary)
|
| 54 |
+
payload = {
|
| 55 |
+
"message": something
|
| 56 |
+
}
|
| 57 |
+
# Send the POST request
|
| 58 |
try:
|
| 59 |
+
response = requests.post(url, json=payload, headers=headers)
|
| 60 |
+
# Print the response status code and body
|
| 61 |
+
print(f"Status Code: {response.status_code}")
|
| 62 |
+
print(f"Response Body: {response.json()}")
|
| 63 |
+
except requests.exceptions.RequestException as e:
|
| 64 |
+
print(f"Request failed: {e}")
|
| 65 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
final_answer = FinalAnswerTool()
|
| 68 |
duckducktool = DuckDuckGoSearchTool()
|