Merge pull request #2100 from langchain-ai/vb/copy

langgraph: support copy without update in Pregel
This commit is contained in:
Nuno Campos
2024-10-14 09:12:36 -07:00
committed by GitHub
+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: