Skip to content

Commit d73e49e

Browse files
committed
Fixing some nested decorator properties
1 parent 66239eb commit d73e49e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rigging/prompt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ def __post_init__(self) -> None:
496496

497497
self.__signature__ = signature
498498
self.__name__ = self.func.__name__
499+
self.__doc__ = self.docstring
499500

500501
@property
501502
def docstring(self) -> str:
@@ -840,6 +841,9 @@ async def run(*args: P.args, **kwargs: P.kwargs) -> R:
840841
results = await self.bind_many(pipeline)(1, *args, **kwargs)
841842
return results[0]
842843

844+
run.__signature__ = self.__signature__ # type: ignore [attr-defined]
845+
run.__name__ = self.__name__
846+
run.__doc__ = self.__doc__
843847
run.__rg_prompt__ = self # type: ignore [attr-defined]
844848

845849
return run

rigging/tool/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def empty_func(*args, **kwargs): # type: ignore [no-untyped-def] # noqa: ARG001
198198

199199
self._signature = signature
200200
self.__signature__ = signature # type: ignore [attr-defined]
201+
self.__name__ = self.name # type: ignore [attr-defined]
202+
self.__doc__ = self.description
201203

202204
# For handling API calls, we'll use the type adapter to validate
203205
# the arguments before calling the function

0 commit comments

Comments
 (0)