mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
feat: introduce payload field to TriggerDispatchResponse and a better typing
This commit is contained in:
@ -247,9 +247,14 @@ class TriggerInvokeEventResponse(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class PluginTriggerDispatchResponse(BaseModel):
|
class PluginTriggerDispatchResponse(BaseModel):
|
||||||
|
"""
|
||||||
|
Original response from plugin daemon
|
||||||
|
"""
|
||||||
|
|
||||||
user_id: str
|
user_id: str
|
||||||
events: list[str]
|
events: list[str]
|
||||||
raw_http_response: str
|
raw_http_response: str
|
||||||
|
payload: Mapping[str, Any] = Field(default_factory=dict)
|
||||||
|
|
||||||
|
|
||||||
class TriggerSubscriptionResponse(BaseModel):
|
class TriggerSubscriptionResponse(BaseModel):
|
||||||
@ -260,12 +265,10 @@ class TriggerValidateProviderCredentialsResponse(BaseModel):
|
|||||||
result: bool
|
result: bool
|
||||||
|
|
||||||
|
|
||||||
class TriggerDispatchResponse:
|
class TriggerDispatchResponse(BaseModel):
|
||||||
user_id: str
|
user_id: str
|
||||||
events: list[str]
|
events: list[str]
|
||||||
response: Response
|
response: Response
|
||||||
|
payload: Mapping[str, Any] = Field(default_factory=dict)
|
||||||
|
|
||||||
def __init__(self, user_id: str, events: list[str], response: Response):
|
model_config = ConfigDict(protected_namespaces=(), arbitrary_types_allowed=True)
|
||||||
self.user_id = user_id
|
|
||||||
self.events = events
|
|
||||||
self.response = response
|
|
||||||
|
|||||||
Reference in New Issue
Block a user