Files
dify-plugin-sdks/python/dify_plugin/core/entities/message.py
T
2024-09-03 23:03:15 +08:00

21 lines
356 B
Python

from enum import Enum
from pydantic import BaseModel
class SessionMessage(BaseModel):
class Type(Enum):
STREAM = "stream"
INVOKE = "invoke"
END = "end"
ERROR = "error"
type: Type
data: dict
def to_dict(self):
return {
'type': self.type.value,
'data': self.data
}