|
15 | 15 | import asyncio
|
16 | 16 | from asyncio import AbstractEventLoop
|
17 | 17 | from threading import Thread
|
| 18 | +from inspect import Signature |
18 | 19 | from typing import Any, Callable, Coroutine, Mapping, Sequence, TypeVar, Union
|
19 | 20 |
|
20 | 21 | from .protocol import ParameterSchema
|
@@ -65,6 +66,28 @@ def __init__(
|
65 | 66 | # a string value immediately, not a descriptor that evaluates later.
|
66 | 67 | self.__qualname__ = f"{self.__class__.__qualname__}.{self.__async_tool._name}"
|
67 | 68 |
|
| 69 | + @property |
| 70 | + def __name__(self) -> str: |
| 71 | + return self.__async_tool.__name__ |
| 72 | + |
| 73 | + @property |
| 74 | + def __doc__(self) -> Union[str, None]: # type: ignore[override] |
| 75 | + # Standard Python object attributes like __doc__ are technically "writable". |
| 76 | + # But not defining a setter function makes this a read-only property. |
| 77 | + # Mypy flags this issue in the type checks. |
| 78 | + return self.__async_tool.__doc__ |
| 79 | + |
| 80 | + @property |
| 81 | + def __signature__(self) -> Signature: |
| 82 | + return self.__async_tool.__signature__ |
| 83 | + |
| 84 | + @property |
| 85 | + def __annotations__(self) -> dict[str, Any]: # type: ignore[override] |
| 86 | + # Standard Python object attributes like __doc__ are technically "writable". |
| 87 | + # But not defining a setter function makes this a read-only property. |
| 88 | + # Mypy flags this issue in the type checks. |
| 89 | + return self.__async_tool.__annotations__ |
| 90 | + |
68 | 91 | @property
|
69 | 92 | def _name(self) -> str:
|
70 | 93 | return self.__async_tool._name
|
|
0 commit comments