mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
refactor(api): rename dify_graph to graphon (#34095)
This commit is contained in:
31
api/graphon/graph_events/base.py
Normal file
31
api/graphon/graph_events/base.py
Normal file
@ -0,0 +1,31 @@
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from graphon.enums import NodeType
|
||||
from graphon.node_events import NodeRunResult
|
||||
|
||||
|
||||
class GraphEngineEvent(BaseModel):
|
||||
pass
|
||||
|
||||
|
||||
class BaseGraphEvent(GraphEngineEvent):
|
||||
pass
|
||||
|
||||
|
||||
class GraphNodeEventBase(GraphEngineEvent):
|
||||
id: str = Field(..., description="node execution id")
|
||||
node_id: str
|
||||
node_type: NodeType
|
||||
|
||||
in_iteration_id: str | None = None
|
||||
"""iteration id if node is in iteration"""
|
||||
in_loop_id: str | None = None
|
||||
"""loop id if node is in loop"""
|
||||
|
||||
# The version of the node, or "1" if not specified.
|
||||
node_version: str = "1"
|
||||
node_run_result: NodeRunResult = Field(default_factory=NodeRunResult)
|
||||
|
||||
|
||||
class GraphAgentNodeEventBase(GraphNodeEventBase):
|
||||
pass
|
||||
Reference in New Issue
Block a user