Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: '8.3'
coverage: none

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: '8.3'
coverage: none

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Watch a quick demo of Intercept in action.
## Requirements

> [!Important]
> Requires PHP 8.4+ and `laravel/ai`.
> Requires PHP 8.3+ and `laravel/ai`.

## AI Agent Middleware collection

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
}
],
"require": {
"php": "^8.4.0",
"php": "^8.3",
"laravel/ai": "*"
},
"require-dev": {
"laravel/pint": "^1.29.1",
"mrpunyapal/rector-pest": "^0.2.15",
"orchestra/testbench": "^10.0|^11.0",
"pestphp/pest": "^5.0.0",
"pestphp/pest-plugin-type-coverage": "^5.0.0",
"phpstan/phpstan": "^2.1.54",
"orchestra/testbench": "^10.6|^11.0",
"pestphp/pest": "^3.0|^4.0|^5.0.0",
"pestphp/pest-plugin-type-coverage": "^3.0|^4.0|^5.0.0",
"phpstan/phpstan": "^2.1",
"rector/rector": "^2.4.2",
"symfony/var-dumper": "^8.0.8"
"symfony/var-dumper": "^7.0|^8.0.8"
},
"replace": {
"promptphp/intercept-injection-guard": "self.version",
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This guide shows the fastest way to install Intercept and add middleware to a La

## Requirements

Requires PHP 8.4+ and `laravel/ai`.
Requires PHP 8.3+ and `laravel/ai`.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion src/InjectionGuard/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^8.4.0",
"php": "^8.3",
"laravel/ai": "*",
"promptphp/intercept-support": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace PromptPHP\Intercept\InjectionGuard\Tests\Fixtures;

use Illuminate\Broadcasting\Channel;
use Laravel\Ai\Approvals\Decisions;
use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Enums\Lab;
use Laravel\Ai\Responses\AgentResponse;
Expand All @@ -14,13 +15,19 @@

final class PromptInjectionGuardTestAgent implements Agent
{
/**
* {@inheritDoc}
*/
public function instructions(): string
{
return 'You are a test agent.';
}

/**
* {@inheritDoc}
*/
public function prompt(
string $prompt,
Decisions|string $prompt,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
Expand All @@ -29,8 +36,11 @@ public function prompt(
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function stream(
string $prompt,
Decisions|string $prompt,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
Expand All @@ -39,42 +49,54 @@ public function stream(
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function queue(
string $prompt,
Decisions|string $prompt,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): QueuedAgentResponse {
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function broadcast(
string $prompt,
Decisions|string $prompt,
Channel|array $channels,
array $attachments = [],
bool $now = false,
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): StreamableAgentResponse {
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function broadcastNow(
string $prompt,
Decisions|string $prompt,
Channel|array $channels,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): StreamableAgentResponse {
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function broadcastOnQueue(
string $prompt,
Decisions|string $prompt,
Channel|array $channels,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): QueuedAgentResponse {
throw new RuntimeException('Not used in this test.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/PIIRedactor/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^8.4",
"php": "^8.3",
"laravel/ai": "*",
"promptphp/intercept-support": "*"
},
Expand Down
42 changes: 32 additions & 10 deletions src/PIIRedactor/tests/Fixtures/PIIRedactorTestAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace PromptPHP\Intercept\PIIRedactor\Tests\Fixtures;

use Illuminate\Broadcasting\Channel;
use Laravel\Ai\Approvals\Decisions;
use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Enums\Lab;
use Laravel\Ai\Responses\AgentResponse;
Expand All @@ -14,13 +15,19 @@

final class PIIRedactorTestAgent implements Agent
{
/**
* {@inheritDoc}
*/
public function instructions(): string
{
return 'You are a test agent.';
}

/**
* {@inheritDoc}
*/
public function prompt(
string $prompt,
Decisions|string $prompt,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
Expand All @@ -29,8 +36,11 @@ public function prompt(
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function stream(
string $prompt,
Decisions|string $prompt,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
Expand All @@ -39,42 +49,54 @@ public function stream(
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function queue(
string $prompt,
Decisions|string $prompt,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): QueuedAgentResponse {
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function broadcast(
string $prompt,
Decisions|string $prompt,
Channel|array $channels,
array $attachments = [],
bool $now = false,
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): StreamableAgentResponse {
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function broadcastNow(
string $prompt,
Decisions|string $prompt,
Channel|array $channels,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): StreamableAgentResponse {
throw new RuntimeException('Not used in this test.');
}

/**
* {@inheritDoc}
*/
public function broadcastOnQueue(
string $prompt,
Decisions|string $prompt,
Channel|array $channels,
array $attachments = [],
Lab|array|string|null $provider = null,
?string $model = null,
?string $model = null
): QueuedAgentResponse {
throw new RuntimeException('Not used in this test.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Support/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^8.4",
"php": "^8.3",
"illuminate/support": "^12.0|^13.0"
},
"autoload": {
Expand Down
Loading