Requirements

  • PHP 8.3 or higher
  • Laravel 11.0 or higher

Installation Steps

  1. Install the package via Composer:
composer require jordan-price/toolbox
  1. Publish the configuration file:
php artisan vendor:publish --tag="toolbox-config"

Configuration

After installation, you can configure the package in your .env file:
# Weather Tool (optional)
WEATHER_API_KEY=your_api_key

Usage with Prism

All tools in this package are designed to work with Echolabs Prism`. Here’s a basic example:
use EchoLabs\Prism\Prism;
use EchoLabs\Prism\Enums\Provider;
use EchoLabs\Prism\Enums\ToolChoice;
use JordanPrice\Toolbox\Tools\Weather\WeatherTool;

$weatherTool = new WeatherTool();

$prism = Prism::text()
    ->using(Provider::Anthropic, 'claude-3-5-sonnet-latest')
    ->withPrompt('What is the weather in London?')
    ->withTools([$weatherTool])  // Pass the tool instance
    ->toolChoice(ToolChoice::Any);

$response = $prism->generate();
For more detailed examples, see the individual tool documentation.