dify/api/core/plugin/entities/plugin_daemon.py
2024-09-20 21:35:19 +08:00

29 lines
534 B
Python

from enum import Enum
from typing import Generic, Optional, TypeVar
from pydantic import BaseModel
T = TypeVar("T", bound=(BaseModel | dict | bool))
class PluginDaemonBasicResponse(BaseModel, Generic[T]):
"""
Basic response from plugin daemon.
"""
code: int
message: str
data: Optional[T]
class InstallPluginMessage(BaseModel):
"""
Message for installing a plugin.
"""
class Event(Enum):
Info = "info"
Done = "done"
Error = "error"
event: Event
data: str