From a722f61c210b7bfba3a319d1594140dd85e5be8d Mon Sep 17 00:00:00 2001 From: Shroominic Date: Thu, 15 Feb 2024 14:03:36 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20Depends=20class=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/funcchain/syntax/params.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/funcchain/syntax/params.py diff --git a/src/funcchain/syntax/params.py b/src/funcchain/syntax/params.py new file mode 100644 index 0000000..83eda08 --- /dev/null +++ b/src/funcchain/syntax/params.py @@ -0,0 +1,20 @@ +from typing import Any, Optional + +from langchain_core.runnables.base import RunnableLike + + +class Depends: + def __init__( + self, + dependency: Optional[RunnableLike[Any, Any]] = None, + ): + self.dependency = dependency + + def __repr__(self) -> str: + return str(self.__class__.__name__) + str( + getattr( + self.dependency, + "__name__", + type(self.dependency).__name__, + ) + )