Real model calls
Evaluate actual AI behavior, not mocked responses.
Make sure your agents respond how you want them to.
composer require --dev larswiegers/laravel-ai-evaluationpest()->extend(Tests\TestCase::class)->in('Feature', 'AgentEvals');No additional setup is required.php artisan make:ai-evals refund-policy --type=pestphp artisan make:ai-evals refund-policy --type=standaloneThe command scaffolds a starter file you can edit for your agent and expectations.
vendor/bin/pest tests/AgentEvalsphp artisan ai-evals:runEnable summaries and choose the format in your .env (or CI environment):
AI_EVAL_SUMMARY=true
AI_EVAL_SUMMARY_FORMAT=text
AI_EVAL_SUMMARY_CURRENCY=USDAI_EVAL_SUMMARY=true
AI_EVAL_SUMMARY_FORMAT=json
AI_EVAL_SUMMARY_CURRENCY=USDRun your evals and check the end of the output:
$ vendor/bin/pest tests/AgentEvals
AI Eval Summary
Passed: 12
Failed: 1
Prompt tokens: 7,842
Completion tokens: 1,966
Total tokens: 9,808
Estimated cost: $0.07 USD$ php artisan ai-evals:run
{"passed":12,"failed":1,"tokens":{"prompt":7842,"completion":1966,"total":9808},"cost":{"amount":0.07,"currency":"USD"}}