Skip to content

Commit ef7772b

Browse files
committed
[Agent][Firecrawl] Add symfony/ai-firecrawl-tool
1 parent a46edd7 commit ef7772b

File tree

16 files changed

+147
-9
lines changed

16 files changed

+147
-9
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please do not submit any Pull Requests here. They will be closed.
2+
---
3+
4+
Please submit your PR here instead:
5+
https://github.com/symfony/ai
6+
7+
This repository is what we call a "subtree split": a read-only subset of that main repository.
8+
We're looking forward to your PR there!
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Close Pull Request
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: superbrothers/close-pull-request@v3
12+
with:
13+
comment: |
14+
Thanks for your Pull Request! We love contributions.
15+
16+
However, you should instead open your PR on the main repository:
17+
https://github.com/symfony/ai
18+
19+
This repository is what we call a "subtree split": a read-only subset of that main repository.
20+
We're looking forward to your PR there!

src/Bridge/Firecrawl/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml
4+
.phpunit.result.cache

src/Bridge/Firecrawl/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG
2+
=========
3+
4+
0.1
5+
---
6+
7+
* Add the bridge

src/Toolbox/Tool/Firecrawl.php renamed to src/Bridge/Firecrawl/Firecrawl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Agent\Toolbox\Tool;
12+
namespace Symfony\AI\Agent\Bridge\Firecrawl;
1313

1414
use Symfony\AI\Agent\Toolbox\Attribute\AsTool;
1515
use Symfony\Contracts\HttpClient\HttpClientInterface;

src/Bridge/Firecrawl/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2025-present Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

tests/Toolbox/Tool/FirecrawlTest.php renamed to src/Bridge/Firecrawl/Tests/FirecrawlTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Agent\Tests\Toolbox\Tool;
12+
namespace Symfony\AI\Agent\Bridge\Firecrawl\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\AI\Agent\Toolbox\Tool\Firecrawl;
15+
use Symfony\AI\Agent\Bridge\Firecrawl\Firecrawl;
1616
use Symfony\Component\HttpClient\MockHttpClient;
1717
use Symfony\Component\HttpClient\Response\JsonMockResponse;
1818

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

2727
$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');
@@ -37,10 +37,10 @@ public function testScrape()
3737
public function testCrawl()
3838
{
3939
$httpClient = new MockHttpClient([
40-
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl-wait.json'),
41-
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl-status.json'),
42-
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl-status-done.json'),
43-
JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-crawl.json'),
40+
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl-wait.json'),
41+
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl-status.json'),
42+
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl-status-done.json'),
43+
JsonMockResponse::fromFile(__DIR__.'/fixtures/crawl.json'),
4444
]);
4545

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

6666
$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');

0 commit comments

Comments
 (0)