PHP code example of hristijans / spatie-agent-tools

1. Go to this page and download the library: Download hristijans/spatie-agent-tools library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hristijans / spatie-agent-tools example snippets


use Hristijans\SpatieAgentTools\Tools\QueryActivityLogTool;
use Hristijans\SpatieAgentTools\Tools\QueryMediaLibraryTool;
use Hristijans\SpatieAgentTools\Tools\QueryPermissionsTool;
use Hristijans\SpatieAgentTools\Tools\QuerySettingsTool;
use Hristijans\SpatieAgentTools\Tools\QueryTagsTool;
use Hristijans\SpatieAgentTools\Tools\QueryTranslatableTool;
use Laravel\Ai\Agents\Agent;
use Laravel\Ai\Contracts\HasTools;

class MyAgent implements Agent, HasTools
{
    public function tools(): iterable
    {
        return [
            new QueryActivityLogTool,
            new QueryPermissionsTool,
            new QueryMediaLibraryTool,
            new QueryTagsTool,
            new QueryTranslatableTool,
            new QuerySettingsTool,
        ];
    }
}