|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +import copy |
15 | 16 | import asyncio
|
16 | 17 | from asyncio import AbstractEventLoop
|
17 | 18 | from inspect import Signature
|
18 | 19 | from threading import Thread
|
19 |
| -from typing import Any, Callable, Mapping, TypeVar, Union |
| 20 | +from typing import Any, Callable, Mapping, TypeVar, Union, Sequence, Coroutine |
| 21 | + |
| 22 | +from .protocol import ParameterSchema |
| 23 | + |
20 | 24 |
|
21 | 25 | from .tool import ToolboxTool
|
22 | 26 |
|
@@ -66,26 +70,32 @@ def __init__(
|
66 | 70 | self.__qualname__ = f"{self.__class__.__qualname__}.{self.__name__}"
|
67 | 71 |
|
68 | 72 | @property
|
69 |
| - def __name__(self) -> str: |
70 |
| - return self.__async_tool._name |
| 73 | + def _name(self) -> str: |
| 74 | + return self.__name__ |
| 75 | + |
| 76 | + @property |
| 77 | + def _description(self) -> str: |
| 78 | + return self.__async_tool._description |
| 79 | + |
| 80 | + @property |
| 81 | + def _params(self) -> Sequence[ParameterSchema]: |
| 82 | + return self.__async_tool._params |
| 83 | + |
| 84 | + @property |
| 85 | + def _bound_params(self) -> Mapping[str, Union[Callable[[], Any], Any]]: |
| 86 | + return self.__async_tool._bound_params |
71 | 87 |
|
72 | 88 | @property
|
73 |
| - def __doc__(self) -> Union[str, None]: # type: ignore[override] |
74 |
| - # Standard Python object attributes like __doc__ are technically "writable". |
75 |
| - # But not defining a setter function makes this a read-only property. |
76 |
| - # Mypy flags this issue in the type checks. |
77 |
| - return self.__async_tool.__doc__ |
| 89 | + def _required_auth_params(self) -> Mapping[str, list[str]]: |
| 90 | + return self.__async_tool._required_auth_params |
78 | 91 |
|
79 | 92 | @property
|
80 |
| - def __signature__(self) -> Signature: |
81 |
| - return self.__async_tool.__signature__ |
| 93 | + def _auth_service_token_getters(self) -> Mapping[str, Callable[[], str]]: |
| 94 | + return self.__async_tool._auth_service_token_getters |
82 | 95 |
|
83 | 96 | @property
|
84 |
| - def __annotations__(self) -> dict[str, Any]: # type: ignore[override] |
85 |
| - # Standard Python object attributes like __doc__ are technically "writable". |
86 |
| - # But not defining a setter function makes this a read-only property. |
87 |
| - # Mypy flags this issue in the type checks. |
88 |
| - return self.__async_tool.__annotations__ |
| 97 | + def _client_headers(self) -> Mapping[str, Union[Callable, Coroutine, str]]: |
| 98 | + return self.__async_tool._client_headers |
89 | 99 |
|
90 | 100 | def __call__(self, *args: Any, **kwargs: Any) -> str:
|
91 | 101 | """
|
|
0 commit comments