Naar de inhoud

Testing

The package factories make test data easy:

use SpaanProductions\LaravelAiUsage\Models\AiModel;
use SpaanProductions\LaravelAiUsage\Models\AiUsageRecord;

AiModel::factory()->withPricing(input: 2, output: 10, cachedInput: 0.5)->create(['model_id' => 'gpt-4o']);
AiUsageRecord::factory()->create(['feature' => 'invoice_reading', 'total_cost' => 1.25]);
AiUsageRecord::factory()->failed()->create();

laravel/ai fakes (Agent::fake()) are recorded too, but with zero tokens.

For three months of demo data, run the seeder. Running it again replaces the earlier demo rows:

php artisan db:seed --class="SpaanProductions\LaravelAiUsage\Database\Seeders\AiUsageDemoSeeder"
Een fout gevonden of een vraag? Maak een issue aan op GitHub
Detail Z · Contact

Meer weten? Neem contact op.

Vertel ons kort wat je zoekt. We denken graag met je mee, ook als je nog niet precies weet wat je nodig hebt.