1717
1818import pytest
1919import pytest_asyncio
20+ from llama_index .core .tools .types import ToolOutput
2021from pydantic import ValidationError
2122from toolbox_core .protocol import ParameterSchema as CoreParameterSchema
2223from toolbox_core .tool import ToolboxTool as ToolboxCoreTool
@@ -261,7 +262,14 @@ async def test_toolbox_tool_call_requires_auth_strict(self, auth_toolbox_tool):
261262
262263 async def test_toolbox_tool_call (self , toolbox_tool ):
263264 result = await toolbox_tool .acall (param1 = "test-value" , param2 = 123 )
264- assert result == "test-result"
265+ assert result == ToolOutput (
266+ content = "test-result" ,
267+ tool_name = "test_tool" ,
268+ raw_input = {"param1" : "test-value" , "param2" : 123 },
269+ raw_output = "test-result" ,
270+ is_error = False ,
271+ )
272+
265273 core_tool = toolbox_tool ._AsyncToolboxTool__core_tool
266274 core_tool ._ToolboxTool__session .post .assert_called_once_with (
267275 "http://test_url/api/tool/test_tool/invoke" ,
@@ -281,7 +289,13 @@ async def test_toolbox_tool_call_with_bound_params(
281289 ):
282290 tool = toolbox_tool .bind_params (bound_param_map )
283291 result = await tool .acall (param2 = 123 )
284- assert result == "test-result"
292+ assert result == ToolOutput (
293+ content = "test-result" ,
294+ tool_name = "test_tool" ,
295+ raw_input = {"param2" : 123 },
296+ raw_output = "test-result" ,
297+ is_error = False ,
298+ )
285299 core_tool = tool ._AsyncToolboxTool__core_tool
286300 core_tool ._ToolboxTool__session .post .assert_called_once_with (
287301 "http://test_url/api/tool/test_tool/invoke" ,
@@ -294,7 +308,14 @@ async def test_toolbox_tool_call_with_auth_tokens(self, auth_toolbox_tool):
294308 {"test-auth-source" : lambda : "test-token" }
295309 )
296310 result = await tool .acall (param2 = 123 )
297- assert result == "test-result"
311+ assert result == ToolOutput (
312+ content = "test-result" ,
313+ tool_name = "test_tool" ,
314+ raw_input = {"param2" : 123 },
315+ raw_output = "test-result" ,
316+ is_error = False ,
317+ )
318+
298319 core_tool = tool ._AsyncToolboxTool__core_tool
299320 core_tool ._ToolboxTool__session .post .assert_called_once_with (
300321 "https://test-url/api/tool/test_tool/invoke" ,
@@ -325,7 +346,13 @@ async def test_toolbox_tool_call_with_auth_tokens_insecure(
325346 {"test-auth-source" : lambda : "test-token" }
326347 )
327348 result = await tool_with_getter .acall (param2 = 123 )
328- assert result == "test-result"
349+ assert result == ToolOutput (
350+ content = "test-result" ,
351+ tool_name = "test_tool" ,
352+ raw_input = {"param2" : 123 },
353+ raw_output = "test-result" ,
354+ is_error = False ,
355+ )
329356
330357 modified_core_tool_in_new_tool = tool_with_getter ._AsyncToolboxTool__core_tool
331358 assert (
0 commit comments