Skip to content

Commit 7dcf6a5

Browse files
authored
fix: update method calls from dict to model_dump in Chain (#33035)
1 parent 043a756 commit 7dcf6a5

File tree

1 file changed

+3
-3
lines changed
  • libs/langchain/langchain/chains

1 file changed

+3
-3
lines changed

libs/langchain/langchain/chains/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,11 @@ def dict(self, **kwargs: Any) -> dict:
750750
Example:
751751
.. code-block:: python
752752
753-
chain.dict(exclude_unset=True)
753+
chain.model_dump(exclude_unset=True)
754754
# -> {"_type": "foo", "verbose": False, ...}
755755
756756
"""
757-
_dict = super().dict(**kwargs)
757+
_dict = super().model_dump(**kwargs)
758758
with contextlib.suppress(NotImplementedError):
759759
_dict["_type"] = self._chain_type
760760
return _dict
@@ -779,7 +779,7 @@ def save(self, file_path: Union[Path, str]) -> None:
779779
raise ValueError(msg)
780780

781781
# Fetch dictionary to save
782-
chain_dict = self.dict()
782+
chain_dict = self.model_dump()
783783
if "_type" not in chain_dict:
784784
msg = f"Chain {self} does not support saving."
785785
raise NotImplementedError(msg)

0 commit comments

Comments
 (0)