1717use Symfony \AI \Agent \Toolbox \Exception \ToolNotFoundException ;
1818use Symfony \AI \Agent \Toolbox \FaultTolerantToolbox ;
1919use Symfony \AI \Agent \Toolbox \ToolboxInterface ;
20+ use Symfony \AI \Agent \Toolbox \ToolResult ;
2021use Symfony \AI \Fixtures \Tool \ToolNoParams ;
2122use Symfony \AI \Fixtures \Tool \ToolRequiredParams ;
2223use Symfony \AI \Platform \Result \ToolCall ;
@@ -37,7 +38,7 @@ public function testFaultyToolExecution()
3738 $ toolCall = new ToolCall ('987654321 ' , 'tool_foo ' );
3839 $ actual = $ faultTolerantToolbox ->execute ($ toolCall );
3940
40- $ this ->assertSame ($ expected , $ actual );
41+ $ this ->assertSame ($ expected , $ actual-> getResult () );
4142 }
4243
4344 public function testFaultyToolCall ()
@@ -52,7 +53,7 @@ public function testFaultyToolCall()
5253 $ toolCall = new ToolCall ('123456789 ' , 'tool_xyz ' );
5354 $ actual = $ faultTolerantToolbox ->execute ($ toolCall );
5455
55- $ this ->assertSame ($ expected , $ actual );
56+ $ this ->assertSame ($ expected , $ actual-> getResult () );
5657 }
5758
5859 public function testCustomToolExecutionException ()
@@ -72,7 +73,7 @@ public function getToolCallResult(): array
7273 $ toolCall = new ToolCall ('123456789 ' , 'tool_xyz ' );
7374 $ actual = $ faultTolerantToolbox ->execute ($ toolCall );
7475
75- $ this ->assertSame ($ expected , $ actual );
76+ $ this ->assertSame ($ expected , $ actual-> getResult () );
7677 }
7778
7879 private function createFaultyToolbox (\Closure $ exceptionFactory ): ToolboxInterface
@@ -93,7 +94,7 @@ public function getTools(): array
9394 ];
9495 }
9596
96- public function execute (ToolCall $ toolCall ): mixed
97+ public function execute (ToolCall $ toolCall ): ToolResult
9798 {
9899 throw ($ this ->exceptionFactory )($ toolCall );
99100 }
0 commit comments