forked from open-webui/open-webui
feat: webhook backend
This commit is contained in:
parent
16fe0ee167
commit
2c6e2d5e8a
6 changed files with 60 additions and 2 deletions
11
backend/utils/webhook.py
Normal file
11
backend/utils/webhook.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import requests
|
||||
|
||||
|
||||
def post_webhook(url: str, json: dict) -> bool:
|
||||
try:
|
||||
r = requests.post(url, json=json)
|
||||
r.raise_for_status()
|
||||
return True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue