11"""UiPath Runtime Schema Definitions."""
22
3- from typing import Any
3+ from typing import Any , Optional
44
55from pydantic import BaseModel , ConfigDict , Field
66
1313)
1414
1515
16+ class UiPathRuntimeNode (BaseModel ):
17+ """Represents a node in the runtime graph."""
18+
19+ id : str = Field (..., description = "Unique node identifier" )
20+ name : str = Field (..., description = "Display name of the node" )
21+ type : str = Field (..., description = "Node type (e.g., 'tool', 'model')" )
22+
23+ model_config = COMMON_MODEL_SCHEMA
24+
25+
26+ class UiPathRuntimeEdge (BaseModel ):
27+ """Represents an edge/connection in the runtime graph."""
28+
29+ source : str = Field (..., description = "Source node" )
30+ target : str = Field (..., description = "Target node" )
31+ label : Optional [str ] = Field (None , description = "Edge label or condition" )
32+
33+ model_config = COMMON_MODEL_SCHEMA
34+
35+
36+ class UiPathRuntimeGraph (BaseModel ):
37+ """Represents the runtime structure as a graph."""
38+
39+ nodes : list [UiPathRuntimeNode ] = Field (default_factory = list )
40+ edges : list [UiPathRuntimeEdge ] = Field (default_factory = list )
41+
42+ model_config = COMMON_MODEL_SCHEMA
43+
44+
1645class UiPathRuntimeSchema (BaseModel ):
1746 """Represents the UiPath runtime schema."""
1847
@@ -21,10 +50,16 @@ class UiPathRuntimeSchema(BaseModel):
2150 type : str = Field (..., alias = "type" )
2251 input : dict [str , Any ] = Field (..., alias = "input" )
2352 output : dict [str , Any ] = Field (..., alias = "output" )
53+ graph : Optional [UiPathRuntimeGraph ] = Field (
54+ None , description = "Runtime graph structure for debugging"
55+ )
2456
2557 model_config = COMMON_MODEL_SCHEMA
2658
2759
2860__all__ = [
2961 "UiPathRuntimeSchema" ,
62+ "UiPathRuntimeGraph" ,
63+ "UiPathRuntimeNode" ,
64+ "UiPathRuntimeEdge" ,
3065]
0 commit comments