..
This commit is contained in:
@@ -271,5 +271,30 @@ class OpenWebUIChannels:
|
||||
print(f"Error sending message to channel: {str(e)}")
|
||||
return None
|
||||
|
||||
def get_webhooks(self) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Get all registered webhooks.
|
||||
|
||||
Returns:
|
||||
List of webhook data.
|
||||
"""
|
||||
try:
|
||||
# Make API request to get webhooks
|
||||
response = requests.get(
|
||||
f"{self.openwebui_url}/api/webhooks",
|
||||
headers=self.headers,
|
||||
timeout=30
|
||||
)
|
||||
|
||||
if response.status_code == 200:
|
||||
return response.json()
|
||||
else:
|
||||
print(f"Error getting webhooks: {response.status_code} - {response.text}")
|
||||
return []
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error getting webhooks: {str(e)}")
|
||||
return []
|
||||
|
||||
# Create a singleton instance
|
||||
openwebui_channels = OpenWebUIChannels()
|
||||
|
||||
Reference in New Issue
Block a user