|
14 | 14 |
|
15 | 15 | import asyncio
|
16 | 16 | from asyncio import AbstractEventLoop
|
| 17 | +from inspect import Signature |
17 | 18 | from threading import Thread
|
18 |
| -from typing import Any, Awaitable, Callable, Mapping, TypeVar, Union |
| 19 | +from typing import Any, Callable, Mapping, TypeVar, Union |
19 | 20 |
|
20 | 21 | from .tool import ToolboxTool
|
21 | 22 |
|
@@ -54,14 +55,24 @@ def __init__(
|
54 | 55 | self.__async_tool = async_tool
|
55 | 56 | self.__loop = loop
|
56 | 57 | self.__thread = thread
|
57 |
| - |
58 |
| - # Delegate introspection attributes to the wrapped async tool |
59 |
| - self.__name__ = self.__async_tool.__name__ |
60 |
| - self.__doc__ = self.__async_tool.__doc__ |
61 |
| - self.__signature__ = self.__async_tool.__signature__ |
62 |
| - self.__annotations__ = self.__async_tool.__annotations__ |
63 | 58 | # TODO: self.__qualname__ ?? (Consider if needed)
|
64 | 59 |
|
| 60 | + @property |
| 61 | + def __name__(self) -> str: |
| 62 | + return self.__async_tool.__name__ |
| 63 | + |
| 64 | + @property |
| 65 | + def __doc__(self) -> str | None: # Docstring can be None |
| 66 | + return self.__async_tool.__doc__ |
| 67 | + |
| 68 | + @property |
| 69 | + def __signature__(self) -> Signature: |
| 70 | + return self.__async_tool.__signature__ |
| 71 | + |
| 72 | + @property |
| 73 | + def __annotations__(self) -> dict[str, Any]: |
| 74 | + return self.__async_tool.__annotations__ |
| 75 | + |
65 | 76 | def __call__(self, *args: Any, **kwargs: Any) -> str:
|
66 | 77 | """
|
67 | 78 | Synchronously calls the remote tool with the provided arguments.
|
|
0 commit comments