Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(php-sdk): use underscore-prefixed integration tag for old API compatibility

Kris Oeif3dabd19834b
diff --git a/apps/api/src/utils/integration.ts b/apps/api/src/utils/integration.ts
index 12b88a807..1fb57c83b 100644
--- a/apps/api/src/utils/integration.ts
+++ b/apps/api/src/utils/integration.ts
@@ -19,7 +19,6 @@ enum IntegrationEnum {
HERMES = "hermes",
GSTACK = "gstack",
PROMETHEUS = "prometheus",
- LARAVEL_AI = "laravel-ai",
}
export const integrationSchema = z
diff --git a/apps/php-sdk/src/Laravel/Tools/FirecrawlTool.php b/apps/php-sdk/src/Laravel/Tools/FirecrawlTool.php
index 640adc186..a22b082ff 100644
--- a/apps/php-sdk/src/Laravel/Tools/FirecrawlTool.php
+++ b/apps/php-sdk/src/Laravel/Tools/FirecrawlTool.php
@@ -12,7 +12,11 @@ use Laravel\Ai\Contracts\Tool;
abstract class FirecrawlTool implements Tool
{
- protected const INTEGRATION = 'laravel-ai';
+ // Prefixed with an underscore because the API's integration validator
+ // accepts any value starting with `_` on every deployed version, letting
+ // these tools work against lagging or self-hosted APIs with no deploy
+ // ordering requirement.
+ protected const INTEGRATION = '_laravel-ai';
public function __construct(
private ?FirecrawlClient $client = null,
diff --git a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlCrawlTest.php b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlCrawlTest.php
index c5fe8ea86..2f8ebf63c 100644
--- a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlCrawlTest.php
+++ b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlCrawlTest.php
@@ -35,7 +35,7 @@ it('crawls a site and returns pages as JSON', function (): void {
expect($body['url'])->toBe('https://example.com');
expect($body['limit'])->toBe(5);
expect($body['scrapeOptions']['formats'])->toBe(['markdown']);
- expect($body['integration'])->toBe('laravel-ai');
+ expect($body['integration'])->toBe('_laravel-ai');
});
it('clamps the page limit between 1 and 25', function (): void {
diff --git a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlMapTest.php b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlMapTest.php
index 328ed3ffb..5cfe9fe56 100644
--- a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlMapTest.php
+++ b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlMapTest.php
@@ -32,7 +32,7 @@ it('maps a site and returns discovered URLs as JSON', function (): void {
$body = json_decode((string) $history[0]['request']->getBody(), true);
expect($body['url'])->toBe('https://example.com');
expect($body['limit'])->toBe(100);
- expect($body['integration'])->toBe('laravel-ai');
+ expect($body['integration'])->toBe('_laravel-ai');
expect($body)->not->toHaveKey('search');
});
diff --git a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlScrapeTest.php b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlScrapeTest.php
index 0223ab011..8e03374b6 100644
--- a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlScrapeTest.php
+++ b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlScrapeTest.php
@@ -29,7 +29,7 @@ it('scrapes a URL and returns markdown', function (): void {
$body = json_decode((string) $history[0]['request']->getBody(), true);
expect($body['url'])->toBe('https://example.com');
expect($body['formats'])->toBe(['markdown']);
- expect($body['integration'])->toBe('laravel-ai');
+ expect($body['integration'])->toBe('_laravel-ai');
});
it('prepends scrape warnings to the content', function (): void {
diff --git a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlSearchTest.php b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlSearchTest.php
index 829f8d813..dd5fe6278 100644
--- a/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlSearchTest.php
+++ b/apps/php-sdk/tests/Unit/LaravelTools/FirecrawlSearchTest.php
@@ -30,7 +30,7 @@ it('searches the web and returns JSON results', function (): void {
$body = json_decode((string) $history[0]['request']->getBody(), true);
expect($body['query'])->toBe('firecrawl');
expect($body['limit'])->toBe(5);
- expect($body['integration'])->toBe('laravel-ai');
+ expect($body['integration'])->toBe('_laravel-ai');
});
it('clamps the limit between 1 and 20', function (): void {