2.12.6
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(...)
),
];
}
}