mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-08-26 18:56:41 -04:00
21 lines
356 B
Python
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
|
|
}
|