mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 10:25:23 -04:00
20 lines
514 B
Python
20 lines
514 B
Python
from abc import ABC, abstractmethod
|
|
from collections.abc import Mapping
|
|
from werkzeug import Request, Response
|
|
|
|
|
|
class Webhook(ABC):
|
|
def invoke(self, r: Request, values: Mapping) -> Response:
|
|
"""
|
|
Invokes the webhook with the given request.
|
|
"""
|
|
return self._invoke(r, values)
|
|
|
|
@abstractmethod
|
|
def _invoke(self, r: Request, values: Mapping) -> Response:
|
|
"""
|
|
Invokes the webhook with the given request.
|
|
|
|
To be implemented by subclasses.
|
|
"""
|