From f8a0b7a4648b0de618183fa967fced2aa1bf6026 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 23 Oct 2024 13:24:19 -0700 Subject: [PATCH] Use if_not_exists --- libs/langgraph/langgraph/pregel/remote.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/langgraph/langgraph/pregel/remote.py b/libs/langgraph/langgraph/pregel/remote.py index 59150b7b1..9d6572334 100644 --- a/libs/langgraph/langgraph/pregel/remote.py +++ b/libs/langgraph/langgraph/pregel/remote.py @@ -407,6 +407,7 @@ class RemoteGraph(PregelProtocol, Runnable): interrupt_before=interrupt_before, interrupt_after=interrupt_after, stream_subgraphs=subgraphs, + if_not_exists="create", ): if chunk.event.startswith("updates"): if isinstance(chunk.data, dict) and INTERRUPT in chunk.data: @@ -453,6 +454,7 @@ class RemoteGraph(PregelProtocol, Runnable): interrupt_before=interrupt_before, interrupt_after=interrupt_after, stream_subgraphs=subgraphs, + if_not_exists="create", ): if chunk.event.startswith("updates"): if isinstance(chunk.data, dict) and INTERRUPT in chunk.data: @@ -494,6 +496,7 @@ class RemoteGraph(PregelProtocol, Runnable): config=sanitized_config, interrupt_before=interrupt_before, interrupt_after=interrupt_after, + if_not_exists="create", ) async def ainvoke( @@ -514,4 +517,5 @@ class RemoteGraph(PregelProtocol, Runnable): config=sanitized_config, interrupt_before=interrupt_before, interrupt_after=interrupt_after, + if_not_exists="create", )