mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-04-23 06:09:43 +08:00

Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: Yi <yxiaoisme@gmail.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
21 lines
667 B
Python
21 lines
667 B
Python
from pydantic import BaseModel, Field
|
|
|
|
from core.workflow.entities.node_entities import NodeRunResult
|
|
|
|
|
|
class RunCompletedEvent(BaseModel):
|
|
run_result: NodeRunResult = Field(..., description="run result")
|
|
|
|
|
|
class RunStreamChunkEvent(BaseModel):
|
|
chunk_content: str = Field(..., description="chunk content")
|
|
from_variable_selector: list[str] = Field(..., description="from variable selector")
|
|
|
|
|
|
class RunRetrieverResourceEvent(BaseModel):
|
|
retriever_resources: list[dict] = Field(..., description="retriever resources")
|
|
context: str = Field(..., description="context")
|
|
|
|
|
|
RunEvent = RunCompletedEvent | RunStreamChunkEvent | RunRetrieverResourceEvent
|