Skip to content

Commit b6a6904

Browse files
committed
[REL-11697] lint
1 parent 889bd6c commit b6a6904

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

packages/sdk/server-ai/src/ldai/agent_graph/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ def terminal_nodes(self) -> List[AgentGraphNode]:
150150
if len(self.get_child_nodes(node.get_key())) == 0
151151
]
152152

153-
def root(self) -> AgentGraphNode:
153+
def root(self) -> Optional[AgentGraphNode]:
154154
"""Get the root node of the graph."""
155155
return self._nodes.get(self._agent_graph.root_config_key)
156156

157157
def traverse(
158158
self,
159159
fn: Callable[["AgentGraphNode", Dict[str, Any]], Any],
160-
execution_context: Dict[str, Any] = None,
160+
execution_context: Optional[Dict[str, Any]] = None,
161161
) -> Any:
162162
"""Traverse from the root down to terminal nodes, visiting nodes in order of depth.
163163
Nodes with the longest paths from the root (deepest nodes) will always be visited last."""
@@ -205,9 +205,8 @@ def traverse(
205205
def reverse_traverse(
206206
self,
207207
fn: Callable[["AgentGraphNode", Dict[str, Any]], Any],
208-
execution_context: Dict[str, Any] = None,
208+
execution_context: Optional[Dict[str, Any]] = None,
209209
) -> Any:
210-
211210
"""Traverse from terminal nodes up to the root, visiting nodes level by level.
212211
The root node will always be visited last, even if multiple paths converge at it."""
213212
if execution_context is None:
@@ -255,4 +254,3 @@ def reverse_traverse(
255254
)
256255

257256
return execution_context[self._agent_graph.root_config_key]
258-

0 commit comments

Comments
 (0)