Skip to content

2.12.6

Choose a tag to compare

@ilvalerione ilvalerione released this 18 Feb 16:37
· 4 commits to 2.x since this release

Tool Visibility helper

You can condition the visibility of tools based on custom rules. The Tool class provides you with the visible method to determine if the agent should even known the tool exists:

class YouTubeAgent extends Agent
{
    ...
    
    protected function tools(): array
    {
        return [
            GetTranscriptionTool::make('API_KEY')->visible(
                auth()->user()->can(...)
            ),
        ];
    }
}