Skip to content

Commit c21a43d

Browse files
committed
[Agent][SerpApi] Add symfony/ai-serpapi-tool
1 parent 7516cc6 commit c21a43d

File tree

15 files changed

+235
-5
lines changed

15 files changed

+235
-5
lines changed

demo/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"runtime/frankenphp-symfony": "^0.2.0",
1616
"symfony/ai-bundle": "@dev",
1717
"symfony/ai-openmeteo-tool": "@dev",
18+
"symfony/ai-serpapi-tool": "@dev",
1819
"symfony/asset": "~7.3.0",
1920
"symfony/asset-mapper": "~7.3.0",
2021
"symfony/clock": "~7.3.0",

demo/config/packages/ai.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ services:
107107

108108
# Symfony\AI\Agent\Toolbox\Tool\Clock: ~
109109
# Symfony\AI\Agent\Bridge\OpenMeteo\OpenMeteo: ~
110-
# Symfony\AI\Agent\Toolbox\Tool\SerpApi:
110+
# Symfony\AI\Agent\Bridge\SerpApi\SerpApi:
111111
# $apiKey: '%env(SERP_API_KEY)%'
112112
Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~
113113
Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch:

docs/bundles/ai-bundle.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ The following tools can be installed as dedicated packages, no configuration is
779779
$ composer require symfony/ai-firecrawl-tool
780780
$ composer require symfony/ai-mapbox-tool
781781
$ composer require symfony/ai-openmeteo-tool
782+
$ composer require symfony/ai-serpapi-tool
782783
$ composer require symfony/ai-tavily-tool
783784
784785
For tools not available as dedicated packages (those in the ``Toolbox\Tool`` namespace), register them manually as services:
@@ -791,8 +792,6 @@ For tools not available as dedicated packages (those in the ``Toolbox\Tool`` nam
791792
autoconfigure: true
792793
793794
Symfony\AI\Agent\Toolbox\Tool\Clock: ~
794-
Symfony\AI\Agent\Toolbox\Tool\SerpApi:
795-
$apiKey: '%env(SERP_API_KEY)%'
796795
Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch: ~
797796
Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~
798797
Symfony\AI\Agent\Toolbox\Tool\YouTubeTranscriber: ~

examples/toolbox/serpapi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
*/
1111

1212
use Symfony\AI\Agent\Agent;
13+
use Symfony\AI\Agent\Bridge\SerpApi\SerpApi;
1314
use Symfony\AI\Agent\Toolbox\AgentProcessor;
1415
use Symfony\AI\Agent\Toolbox\Tool\Clock;
1516
use Symfony\AI\Agent\Toolbox\Tool\Scraper;
16-
use Symfony\AI\Agent\Toolbox\Tool\SerpApi;
1717
use Symfony\AI\Agent\Toolbox\Toolbox;
1818
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1919
use Symfony\AI\Platform\Message\Message;
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!
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
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
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.

0 commit comments

Comments
 (0)