Skip to content

Commit 93e7712

Browse files
committed
fix: Fix issue of unknown parameter due to pydantic initialization
1 parent 46a6948 commit 93e7712

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ def __init__(
3838
Args:
3939
core_tool: The underlying core async ToolboxTool instance.
4040
"""
41-
42-
self.__core_tool = core_tool
4341
super().__init__(
4442
name=self.__core_tool.__name__,
4543
description=self.__core_tool.__doc__,
4644
args_schema=self.__core_tool._ToolboxTool__pydantic_model,
4745
)
46+
self.__core_tool = core_tool
4847

4948
def _run(self, **kwargs: Any) -> str:
5049
raise NotImplementedError("Synchronous methods not supported by async tools.")

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ def __init__(
3636
Args:
3737
core_sync_tool: The underlying core sync ToolboxTool instance.
3838
"""
39-
40-
self.__core_sync_tool = core_sync_tool
4139
super().__init__(
4240
name=self.__core_sync_tool.__name__,
4341
description=self.__core_sync_tool.__doc__,
4442
args_schema=self.__core_sync_tool._ToolboxSyncTool__async_tool._ToolboxTool__pydantic_model,
4543
)
44+
self.__core_sync_tool = core_sync_tool
4645

4746
def _run(self, **kwargs: Any) -> dict[str, Any]:
4847
return self.__core_sync_tool(**kwargs)

0 commit comments

Comments
 (0)