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 docs/bundles/ai-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ To use existing tools, you can register them as a service:
Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch: ~
Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~
Symfony\AI\Agent\Toolbox\Tool\YouTubeTranscriber: ~
Symfony\AI\Agent\Toolbox\Tool\Firecrawl:
Symfony\AI\Agent\Bridge\Firecrawl\Firecrawl:
$endpoint: '%env(FIRECRAWL_ENDPOINT)%'
$apiKey: '%env(FIRECRAWL_API_KEY)%'
Symfony\AI\Agent\Bridge\Brave\Brave:
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbox/firecrawl-crawl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Bridge\Firecrawl\Firecrawl;
use Symfony\AI\Agent\Toolbox\AgentProcessor;
use Symfony\AI\Agent\Toolbox\Tool\Firecrawl;
use Symfony\AI\Agent\Toolbox\Toolbox;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbox/firecrawl-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Bridge\Firecrawl\Firecrawl;
use Symfony\AI\Agent\Toolbox\AgentProcessor;
use Symfony\AI\Agent\Toolbox\Tool\Firecrawl;
use Symfony\AI\Agent\Toolbox\Toolbox;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbox/firecrawl-scrape.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Bridge\Firecrawl\Firecrawl;
use Symfony\AI\Agent\Toolbox\AgentProcessor;
use Symfony\AI\Agent\Toolbox\Tool\Firecrawl;
use Symfony\AI\Agent\Toolbox\Toolbox;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
Expand Down
3 changes: 3 additions & 0 deletions src/agent/src/Bridge/Firecrawl/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.git* export-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---

Please submit your PR here instead:
https://github.com/symfony/ai

This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
20 changes: 20 additions & 0 deletions src/agent/src/Bridge/Firecrawl/.github/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/symfony/ai
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
4 changes: 4 additions & 0 deletions src/agent/src/Bridge/Firecrawl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/
composer.lock
phpunit.xml
.phpunit.result.cache
7 changes: 7 additions & 0 deletions src/agent/src/Bridge/Firecrawl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CHANGELOG
=========

0.1
---

* Add the bridge
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Symfony\AI\Agent\Toolbox\Tool;
namespace Symfony\AI\Agent\Bridge\Firecrawl;

use Symfony\AI\Agent\Toolbox\Attribute\AsTool;
use Symfony\Contracts\HttpClient\HttpClientInterface;
Expand Down
19 changes: 19 additions & 0 deletions src/agent/src/Bridge/Firecrawl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2025-present Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/

namespace Symfony\AI\Agent\Tests\Toolbox\Tool;
namespace Symfony\AI\Agent\Bridge\Firecrawl\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Toolbox\Tool\Firecrawl;
use Symfony\AI\Agent\Bridge\Firecrawl\Firecrawl;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;

Expand All @@ -21,7 +21,7 @@ final class FirecrawlTest extends TestCase
public function testScrape()
{
$httpClient = new MockHttpClient([
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-scrape.json'),
JsonMockResponse::fromFile(__DIR__.'/fixtures/scrape.json'),
]);

$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');
Expand All @@ -37,10 +37,10 @@ public function testScrape()
public function testCrawl()
{
$httpClient = new MockHttpClient([
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl-wait.json'),
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl-status.json'),
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl-status-done.json'),
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl.json'),
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl-wait.json'),
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl-status.json'),
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl-status-done.json'),
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl.json'),
]);

$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');
Expand All @@ -60,7 +60,7 @@ public function testCrawl()
public function testMap()
{
$httpClient = new MockHttpClient([
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-map.json'),
JsonMockResponse::fromFile(__DIR__.'/fixtures/map.json'),
]);

$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');
Expand Down
45 changes: 45 additions & 0 deletions src/agent/src/Bridge/Firecrawl/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "symfony/ai-firecrawl-tool",
"description": "Firecrawl AI tool bridge for Symfony applications.",
"license": "MIT",
"type": "library",
"keywords": ["ai", "bridge", "firecrawl", "agent", "tool"],
"authors": [
{
"name": "Guillaume Loulier",
"email": "[email protected]"
},
{
"name": "Oskar Stark",
"email": "[email protected]"
}
],
"require": {
"php": ">=8.2",
"symfony/ai-agent": "@dev",
"symfony/http-client": "^7.3|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^11.5.13"
},
"autoload": {
"psr-4": {
"Symfony\\AI\\Agent\\Bridge\\Firecrawl\\": ""
}
},
"autoload-dev": {
"psr-4": {
"Symfony\\AI\\Agent\\Bridge\\Firecrawl\\Tests\\": "Tests/"
}
},
"config": {
"sort-packages": true
},
"extra": {
"thanks": {
"name": "symfony/ai",
"url": "https://github.com/symfony/ai"
}
},
"minimum-stability": "dev"
}
32 changes: 32 additions & 0 deletions src/agent/src/Bridge/Firecrawl/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnDeprecation="true"
failOnRisky="true"
failOnWarning="true"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
<testsuite name="Symfony AI Firecrawl Tool Test Suite">
<directory>./Tests/</directory>
</testsuite>
</testsuites>

<source ignoreSuppressionOfDeprecations="true">
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</source>
</phpunit>