Download the PHP package shamrozghouri/laravel-agent-evals without Composer

On this page you can find all versions of the php package shamrozghouri/laravel-agent-evals. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-agent-evals

Laravel Agent Evals

Define AI-agent behavior as test cases, run them against your real agent, and automatically catch regressions before they ship.

Latest Version Total Downloads PHP Version


Table of Contents


What is this?

Laravel Agent Evals is a testing tool for AI agents built with Laravel. Instead of manually checking whether your chatbot, assistant, or LLM-powered feature still behaves correctly after every change, you define its expected behavior as test cases and let the package verify them for you.

Think of it as PHPUnit for AI behavior: you describe what the agent should (or shouldn't) do, run a command, and get pass/fail results.

Why use it?

LLM-powered agents break silently. A tweaked prompt, a model upgrade, or a new tool can quietly change how your agent responds β€” and you often won't notice until a user complains.

This package helps you:

How it works

  1. You write test cases describing inputs and expected behavior.
  2. The package sends each input to your agent.
  3. It checks the response against your assertions.
  4. Results are compared against a saved baseline to detect regressions.

Requirements

Requirement Version
PHP ^8.1
Laravel 10.x, 11.x, or 12.x

Installation

Install via Composer:

Publish the configuration file:

This creates config/agent-evals.php.

Quick Start (5 minutes)

1. Tell the package about your agent in config/agent-evals.php:

2. Create your first test case in tests/AgentEvals/greeting.php:

3. Run it:

You'll see a pass/fail result in your terminal. That's it β€” you now have your first automated agent eval. πŸŽ‰

Connecting Your Agent

The package calls your agent through Laravel's service container, so any class that's resolvable by the container will work.

Your agent method must:

Register it in config/agent-evals.php:

Writing Test Cases

Test cases live in tests/AgentEvals. Each file must return a single TestCase or an array of them.

Assertions

Method Passes when the response…
->mustContain($text) contains the given text
->mustAvoid($text) does not contain the given text
->mustSatisfy($fn) passes your custom rule (a closure returning bool)

Custom rule example:

Tags

Tags let you group and target related cases (e.g. by topic or risk area):

You can then run only those cases β€” see Running Evals.

Running Evals

Baselines & Regressions

The first successful run saves a baseline β€” a snapshot of known-good results β€” to:

On later runs, the package compares against this baseline:

Important: Tagged runs (--tag=...) never update the baseline. This prevents a partial run from overwriting your full suite's known-good snapshot.

Continuous Integration (CI)

Because regressions cause a non-zero exit code, wiring this into CI takes almost no effort. Example for GitHub Actions (.github/workflows/agent-evals.yml):

Optional Dashboard

A simple web dashboard lets you view the latest baseline in your browser and (for authorized users) trigger a full run.

It is disabled by default. To enable it, add to your .env:

Then visit /agent-evals (or your custom path).

⚠️ Security warning: Before enabling the dashboard in production, protect it with authentication by adding your middleware to dashboard.middleware in config/agent-evals.php. Never expose the ability to run evals publicly.

Configuration Reference

All options live in config/agent-evals.php:

Key Description Default
agent.class The class the package calls to get agent responses. β€”
agent.method The method invoked on that class. handle
paths.cases Directory where test case files live. tests/AgentEvals
paths.baseline Where the baseline snapshot is stored. agent-evals/baseline.json
dashboard.enabled Whether the web dashboard is active. false
dashboard.path URL path for the dashboard. agent-evals
dashboard.middleware Middleware applied to dashboard routes (add auth here!). ['web']

The exact keys may vary slightly β€” check your published config file for the authoritative list.

Troubleshooting

Class "...TestCase" not found Make sure your use statement matches the package namespace exactly: use ShamrozGhouri\LaravelAgentEvals\TestCase;. Then run composer dump-autoload.

"No test cases found" Confirm your files are in tests/AgentEvals (or your configured path) and that each file returns a TestCase or an array of them.

"Agent class not resolvable" Ensure agent.class is correct and the class can be built by Laravel's container (its constructor dependencies are bindable).

Baseline never updates Remember: tagged runs don't update the baseline. Run the full suite (no --tag) to refresh it.

Reporting a Problem

When opening an issue, please include the following (it helps us help you fast):

Run these and paste the output:

Also include:

Please do NOT include:

Contributing

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.

License

Laravel Agent Evals is open-sourced software licensed under the MIT License.


All versions of laravel-agent-evals with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version >=10.0
illuminate/console Version >=10.0
illuminate/routing Version >=10.0
illuminate/view Version >=10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shamrozghouri/laravel-agent-evals contains the following files

Loading the files please wait ...