Skip to content

Commit 941edb6

Browse files
committed
try
1 parent 8d909a9 commit 941edb6

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

packages/toolbox-core/src/toolbox_core/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __parse_tool(
8888
base_url=self.__base_url,
8989
name=name,
9090
description=schema.description,
91-
params=params,
91+
params=tuple(params),
9292
# create a read-only values for the maps to prevent mutation
9393
required_authn_params=types.MappingProxyType(authn_params),
9494
auth_service_token_getters=types.MappingProxyType(auth_token_getters),

packages/toolbox-core/src/toolbox_core/sync_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767

6868
@property
6969
def __name__(self) -> str:
70-
return self.__async_tool.__name__
70+
return self.__async_tool._name
7171

7272
@property
7373
def __doc__(self) -> Union[str, None]: # type: ignore[override]

packages/toolbox-core/src/toolbox_core/tool.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
16-
import types
1715
from inspect import Signature
16+
import copy
1817
from typing import Any, Callable, Coroutine, Mapping, Optional, Sequence, Union
19-
18+
from types import MappingProxyType
2019
from aiohttp import ClientSession
2120

2221
from .protocol import ParameterSchema
@@ -113,6 +112,34 @@ def __init__(
113112
# map of client headers to their value/callable/coroutine
114113
self.__client_headers = client_headers
115114

115+
@property
116+
def _name(self) -> str:
117+
return self.__name__
118+
119+
@property
120+
def _description(self) -> str:
121+
return self.__description
122+
123+
@property
124+
def _params(self) -> Sequence[ParameterSchema]:
125+
return copy.deepcopy(self.__params)
126+
127+
@property
128+
def _bound_params(self) -> Mapping[str, Union[Callable[[], Any], Any]]:
129+
return MappingProxyType(self.__bound_parameters)
130+
131+
@property
132+
def _required_auth_params(self) -> Mapping[str, list[str]]:
133+
return MappingProxyType(self.__required_authn_params)
134+
135+
@property
136+
def _auth_service_token_getters(self) -> Mapping[str, Callable[[], str]]:
137+
return MappingProxyType(self.__auth_service_token_getters)
138+
139+
@property
140+
def _client_headers(self) -> Mapping[str, Union[Callable, Coroutine, str]]:
141+
return MappingProxyType(self.__client_headers)
142+
116143
def __copy(
117144
self,
118145
session: Optional[ClientSession] = None,

0 commit comments

Comments
 (0)