Skip to content

Commit b4a0b54

Browse files
committed
fix(toolbox-langchain): Expose internal state for better debuggability
1 parent d42e234 commit b4a0b54

File tree

1 file changed

+27
-1
lines changed
  • packages/toolbox-langchain/src/toolbox_langchain

1 file changed

+27
-1
lines changed

packages/toolbox-langchain/src/toolbox_langchain/tools.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from asyncio import to_thread
16-
from typing import Any, Callable, Union
16+
from typing import Any, Callable, Union, Mapping, Sequence, Awaitable
1717

1818
from deprecated import deprecated
1919
from langchain_core.tools import BaseTool
@@ -47,6 +47,32 @@ def __init__(
4747
)
4848
self.__core_tool = core_tool
4949

50+
@property
51+
def _bound_params(
52+
self,
53+
) -> Mapping[str, Union[Callable[[], Any], Callable[[], Awaitable[Any]], Any]]:
54+
return self.__core_tool._bound_params
55+
56+
@property
57+
def _required_authn_params(self) -> Mapping[str, list[str]]:
58+
return self.__core_tool._required_authn_params
59+
60+
@property
61+
def _required_authz_tokens(self) -> Sequence[str]:
62+
return self.__core_tool._required_authz_tokens
63+
64+
@property
65+
def _auth_service_token_getters(
66+
self,
67+
) -> Mapping[str, Union[Callable[[], str], Callable[[], Awaitable[str]]]]:
68+
return self.__core_tool._auth_service_token_getters
69+
70+
@property
71+
def _client_headers(
72+
self,
73+
) -> Mapping[str, Union[Callable[[], str], Callable[[], Awaitable[str]], str]]:
74+
return self.__core_tool._client_headers
75+
5076
def _run(self, **kwargs: Any) -> str:
5177
return self.__core_tool(**kwargs)
5278

0 commit comments

Comments
 (0)