Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarda committed Nov 4, 2024
1 parent 7b71627 commit c03f1c2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions libs/langgraph/langgraph/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
# holds the current checkpoint_ns, "" for root graph
CONFIG_KEY_NODE_FINISHED = sys.intern("__pregel_node_finished")
# callback to be called when a node is finished
CONFIG_KEY_METADATA = sys.intern("metadata")
# holds metadata for the graph invocation

# --- Other constants ---
PUSH = sys.intern("__pregel_push")
Expand Down
3 changes: 2 additions & 1 deletion libs/langgraph/langgraph/pregel/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
CONFIG_KEY_DEDUPE_TASKS,
CONFIG_KEY_DELEGATE,
CONFIG_KEY_ENSURE_LATEST,
CONFIG_KEY_METADATA,
CONFIG_KEY_RESUMING,
CONFIG_KEY_STREAM,
CONFIG_KEY_TASK_ID,
Expand Down Expand Up @@ -494,7 +495,7 @@ def _put_checkpoint(self, metadata: CheckpointMetadata) -> None:
# assign step and parents
metadata["step"] = self.step
metadata["parents"] = self.config[CONF].get(CONFIG_KEY_CHECKPOINT_MAP, {})
metadata.update(self.config["metadata"])
metadata.update(self.config[CONFIG_KEY_METADATA])
# debug flag
if self.debug:
print_step_checkpoint(
Expand Down
8 changes: 6 additions & 2 deletions libs/langgraph/tests/test_remote_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def test_get_graph():
"__start__": DrawableNode(
id="__start__", name="__start__", data="__start__", metadata=None
),
"__end__": DrawableNode(id="__end__", name="__end__", data="__end__", metadata=None),
"__end__": DrawableNode(
id="__end__", name="__end__", data="__end__", metadata=None
),
"agent": DrawableNode(
id="agent",
name="agent_1",
Expand Down Expand Up @@ -120,7 +122,9 @@ async def test_aget_graph():
"__start__": DrawableNode(
id="__start__", name="__start__", data="__start__", metadata=None
),
"__end__": DrawableNode(id="__end__", name="__end__", data="__end__", metadata=None),
"__end__": DrawableNode(
id="__end__", name="__end__", data="__end__", metadata=None
),
"agent": DrawableNode(
id="agent",
name="agent_1",
Expand Down

0 comments on commit c03f1c2

Please sign in to comment.