@@ -109,7 +109,13 @@ def mock_core_tool(self, tool_schema_dict):
109109 sync_mock = Mock (spec = ToolboxCoreSyncTool )
110110
111111 sync_mock .__name__ = "test_tool_name_for_langchain"
112- sync_mock .__doc__ = tool_schema_dict ["description" ]
112+ sync_mock ._description = tool_schema_dict ["description" ]
113+ sync_mock .__doc__ = (
114+ f"{ tool_schema_dict ['description' ]} \n \n "
115+ "Args:\n "
116+ " param1 (str): Param 1\n "
117+ " param2 (int): Param 2"
118+ )
113119 sync_mock ._name = "TestToolPydanticModel"
114120 sync_mock ._params = [
115121 CoreParameterSchema (** p ) for p in tool_schema_dict ["parameters" ]
@@ -123,6 +129,7 @@ def mock_core_tool(self, tool_schema_dict):
123129
124130 new_mock_instance_for_methods = Mock (spec = ToolboxCoreSyncTool )
125131 new_mock_instance_for_methods .__name__ = sync_mock .__name__
132+ new_mock_instance_for_methods ._description = sync_mock ._description
126133 new_mock_instance_for_methods .__doc__ = sync_mock .__doc__
127134 new_mock_instance_for_methods ._name = sync_mock ._name
128135 new_mock_instance_for_methods ._params = sync_mock ._params
@@ -145,7 +152,13 @@ def mock_core_tool(self, tool_schema_dict):
145152 def mock_core_sync_auth_tool (self , auth_tool_schema_dict ):
146153 sync_mock = Mock (spec = ToolboxCoreSyncTool )
147154 sync_mock .__name__ = "test_auth_tool_lc_name"
148- sync_mock .__doc__ = auth_tool_schema_dict ["description" ]
155+ sync_mock ._description = auth_tool_schema_dict ["description" ]
156+ sync_mock .__doc__ = (
157+ f"{ auth_tool_schema_dict ['description' ]} \n \n "
158+ "Args:\n "
159+ " param1 (str): Param 1\n "
160+ " param2 (int): Param 2"
161+ )
149162 sync_mock ._name = "TestAuthToolPydanticModel"
150163 sync_mock ._params = [
151164 CoreParameterSchema (** p ) for p in auth_tool_schema_dict ["parameters" ]
@@ -159,6 +172,7 @@ def mock_core_sync_auth_tool(self, auth_tool_schema_dict):
159172
160173 new_mock_instance_for_methods = Mock (spec = ToolboxCoreSyncTool )
161174 new_mock_instance_for_methods .__name__ = sync_mock .__name__
175+ new_mock_instance_for_methods ._description = sync_mock ._description
162176 new_mock_instance_for_methods .__doc__ = sync_mock .__doc__
163177 new_mock_instance_for_methods ._name = sync_mock ._name
164178 new_mock_instance_for_methods ._params = sync_mock ._params
@@ -188,7 +202,8 @@ def test_toolbox_tool_init(self, mock_core_tool):
188202 tool = ToolboxTool (core_tool = mock_core_tool )
189203
190204 assert tool .name == mock_core_tool .__name__
191- assert tool .description == mock_core_tool .__doc__
205+ assert tool .description == mock_core_tool ._description
206+ assert "Args:" not in tool .description
192207 assert tool ._ToolboxTool__core_tool == mock_core_tool
193208
194209 expected_args_schema = params_to_pydantic_model (
0 commit comments