PHP code example of shipfastlabs / toolkit-exa

1. Go to this page and download the library: Download shipfastlabs/toolkit-exa 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/ */

    

shipfastlabs / toolkit-exa example snippets


use Shipfastlabs\Toolkit\Exa\Exa;

$tools = Exa::all(); // Collection<int, Tool>

use Shipfastlabs\Toolkit\Exa\ExaSearch;
use Shipfastlabs\Toolkit\Exa\ExaFindSimilar;
use Shipfastlabs\Toolkit\Exa\ExaGetContents;
use Shipfastlabs\Toolkit\Exa\ExaAnswer;

$tools = [
    new ExaSearch,
    new ExaFindSimilar,
    new ExaGetContents,
    new ExaAnswer,
];

// config/services.php

return [

    // ... existing services ...

    'exa' => [
        'key' => env('EXA_API_KEY'),
    ],

];

// config/ai.php

return [

    // ... existing laravel/ai config ...

    'toolkit' => [
        'exa' => [
            'search' => [
                'num_results' => (int) env('EXA_SEARCH_NUM_RESULTS', 10),
                'type' => env('EXA_SEARCH_TYPE', 'auto'),
                'ool) env('EXA_CONTENTS_TEXT', true),
                'livecrawl' => env('EXA_CONTENTS_LIVECRAWL', 'fallback'),
            ],
            'answer' => [
                '