Merge branch 'nc/11oct/checkpoint-task-result' of github.com:langchain-ai/langgraph into nc/11oct/checkpoint-task-result

This commit is contained in:
vbarda
2024-10-14 13:20:25 -04:00
6 changed files with 22 additions and 36 deletions
+2 -2
View File
@@ -252,8 +252,8 @@ class Pregel(Runnable[Union[dict[str, Any], Any], Union[dict[str, Any], Any]]):
if auto_validate:
self.validate()
def copy(self, update: dict[str, Any]) -> Self:
attrs = {**self.__dict__, **update}
def copy(self, update: dict[str, Any] | None = None) -> Self:
attrs = {**self.__dict__, **(update or {})}
return self.__class__(**attrs)
def with_config(self, config: RunnableConfig | None = None, **kwargs: Any) -> Self:
@@ -154,6 +154,8 @@ class RemoteGraph(PregelProtocol, Runnable):
interrupts=tuple(interrupts),
state=self._create_state_snapshot(task["state"])
if task["state"]
else {"configurable": task["checkpoint"]}
if task["checkpoint"]
else None,
result=task.get("result"),
)