| 37 | return str(uuid.uuid4()) |
| 38 | |
| 39 | class ExecutionNode(BaseModel): |
| 40 | node_id:GID = Field(default_factory=assign_gid) |
| 41 | role: Optional[Any] = None # System, User, Assistant, Tool |
| 42 | message: Optional[Any] = None |
| 43 | in_degree:int = 0 |
| 44 | out_degree:int = 0 |
| 45 | |
| 46 | def __eq__(self, other) -> bool: |
| 47 | if isinstance(other,ExecutionNode): |
| 48 | return self.node_id == other.node_id |
| 49 | raise NotImplementedError('Unsupported operation between {} and {}'.format(type(self),type(other))) |
| 50 | |
| 51 | def __str__(self) -> str: |
| 52 | return str(self.node_id) |
| 53 | |
| 54 | |
| 55 | class DirectedEdge(BaseModel): |
no outgoing calls
no test coverage detected