From 993d11bdc460fde7940d992b951b49872348f505 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 08:19:51 +0200 Subject: [PATCH 01/11] Create symfony/ai-tools package Move third-party tools from agent component to new dedicated package: - Brave Search, Firecrawl, Mapbox, OpenMeteo, SerpApi, Tavily, Wikipedia, YouTube Transcriber - Create new package structure with composer.json, tests, documentation - Update namespaces from Symfony\AI\Agent\Toolbox\Tool to Symfony\AI\Toolbox\Tool - Reorganize test fixtures into tool-specific subdirectories - Update examples and demo configurations to use new package - Clean up agent component by removing moved tools and fixtures --- README.md | 1 + demo/composer.json | 1 + demo/config/packages/ai.yaml | 11 +- examples/aimlapi/toolcall.php | 2 +- examples/anthropic/toolcall.php | 2 +- examples/bedrock/toolcall-claude.php | 2 +- examples/bedrock/toolcall-nova.php | 2 +- examples/composer.json | 1 + examples/dockermodelrunner/toolcall.php | 2 +- examples/mistral/toolcall-stream.php | 2 +- examples/openai/toolcall-stream.php | 2 +- examples/openai/toolcall.php | 2 +- examples/toolbox/brave.php | 2 +- examples/toolbox/firecrawl-crawl.php | 2 +- examples/toolbox/firecrawl-map.php | 2 +- examples/toolbox/firecrawl-scrape.php | 2 +- examples/toolbox/mapbox-geocode.php | 2 +- examples/toolbox/mapbox-reverse-geocode.php | 2 +- examples/toolbox/serpapi.php | 2 +- examples/toolbox/tavily.php | 2 +- examples/toolbox/weather-event.php | 2 +- src/agent/CHANGELOG.md | 7 - src/tools/.gitattributes | 7 + src/tools/AGENTS.md | 29 +++ src/tools/CHANGELOG.md | 14 ++ src/tools/CLAUDE.md | 63 +++++++ src/tools/LICENSE | 19 ++ src/tools/README.md | 172 ++++++++++++++++++ src/tools/composer.json | 53 ++++++ src/tools/doc/index.rst | 125 +++++++++++++ src/tools/phpstan.dist.neon | 12 ++ src/tools/phpunit.xml.dist | 24 +++ .../src/Toolbox => tools/src}/Tool/Brave.php | 2 +- .../Toolbox => tools/src}/Tool/Firecrawl.php | 2 +- .../src/Toolbox => tools/src}/Tool/Mapbox.php | 2 +- .../Toolbox => tools/src}/Tool/OpenMeteo.php | 2 +- .../Toolbox => tools/src}/Tool/SerpApi.php | 2 +- .../src/Toolbox => tools/src}/Tool/Tavily.php | 2 +- .../Toolbox => tools/src}/Tool/Wikipedia.php | 2 +- .../src}/Tool/YouTubeTranscriber.php | 2 +- .../tests}/Tool/BraveTest.php | 8 +- .../tests}/Tool/FirecrawlTest.php | 16 +- .../tests}/Tool/MapboxTest.php | 14 +- .../tests}/Tool/OpenMeteoTest.php | 8 +- .../tests}/Tool/WikipediaTest.php | 14 +- .../tests/fixtures/Tool/brave}/brave.json | 0 .../firecrawl-crawl-status-done.json | 0 .../firecrawl}/firecrawl-crawl-status.json | 0 .../Tool/firecrawl}/firecrawl-crawl-wait.json | 0 .../Tool/firecrawl}/firecrawl-crawl.json | 0 .../Tool/firecrawl}/firecrawl-map.json | 0 .../Tool/firecrawl}/firecrawl-scrape.json | 0 .../Tool/mapbox}/mapbox-geocode-empty.json | 0 .../Tool/mapbox}/mapbox-geocode-multiple.json | 0 .../Tool/mapbox}/mapbox-geocode-single.json | 0 .../mapbox}/mapbox-reverse-geocode-empty.json | 0 .../Tool/mapbox}/mapbox-reverse-geocode.json | 0 .../Tool/openmeteo}/openmeteo-current.json | 0 .../Tool/openmeteo}/openmeteo-forecast.json | 0 .../wikipedia}/wikipedia-article-missing.json | 0 .../wikipedia-article-redirect.json | 0 .../Tool/wikipedia}/wikipedia-article.json | 0 .../wikipedia}/wikipedia-search-empty.json | 0 .../wikipedia}/wikipedia-search-result.json | 0 64 files changed, 582 insertions(+), 67 deletions(-) create mode 100644 src/tools/.gitattributes create mode 100644 src/tools/AGENTS.md create mode 100644 src/tools/CHANGELOG.md create mode 100644 src/tools/CLAUDE.md create mode 100644 src/tools/LICENSE create mode 100644 src/tools/README.md create mode 100644 src/tools/composer.json create mode 100644 src/tools/doc/index.rst create mode 100644 src/tools/phpstan.dist.neon create mode 100644 src/tools/phpunit.xml.dist rename src/{agent/src/Toolbox => tools/src}/Tool/Brave.php (98%) rename src/{agent/src/Toolbox => tools/src}/Tool/Firecrawl.php (98%) rename src/{agent/src/Toolbox => tools/src}/Tool/Mapbox.php (99%) rename src/{agent/src/Toolbox => tools/src}/Tool/OpenMeteo.php (99%) rename src/{agent/src/Toolbox => tools/src}/Tool/SerpApi.php (97%) rename src/{agent/src/Toolbox => tools/src}/Tool/Tavily.php (97%) rename src/{agent/src/Toolbox => tools/src}/Tool/Wikipedia.php (98%) rename src/{agent/src/Toolbox => tools/src}/Tool/YouTubeTranscriber.php (97%) rename src/{agent/tests/Toolbox => tools/tests}/Tool/BraveTest.php (90%) rename src/{agent/tests/Toolbox => tools/tests}/Tool/FirecrawlTest.php (74%) rename src/{agent/tests/Toolbox => tools/tests}/Tool/MapboxTest.php (87%) rename src/{agent/tests/Toolbox => tools/tests}/Tool/OpenMeteoTest.php (86%) rename src/{agent/tests/Toolbox => tools/tests}/Tool/WikipediaTest.php (85%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/brave}/brave.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/firecrawl}/firecrawl-crawl-status-done.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/firecrawl}/firecrawl-crawl-status.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/firecrawl}/firecrawl-crawl-wait.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/firecrawl}/firecrawl-crawl.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/firecrawl}/firecrawl-map.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/firecrawl}/firecrawl-scrape.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/mapbox}/mapbox-geocode-empty.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/mapbox}/mapbox-geocode-multiple.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/mapbox}/mapbox-geocode-single.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/mapbox}/mapbox-reverse-geocode-empty.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/mapbox}/mapbox-reverse-geocode.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/openmeteo}/openmeteo-current.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/openmeteo}/openmeteo-forecast.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/wikipedia}/wikipedia-article-missing.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/wikipedia}/wikipedia-article-redirect.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/wikipedia}/wikipedia-article.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/wikipedia}/wikipedia-search-empty.json (100%) rename src/{agent/tests/fixtures/Tool => tools/tests/fixtures/Tool/wikipedia}/wikipedia-search-result.json (100%) diff --git a/README.md b/README.md index ac65db86d..221028c91 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Symfony AI consists of several lower and higher level **components** and the res * **[Agent](src/agent/README.md)**: Framework for building AI agents that can interact with users and perform tasks. * **[Store](src/store/README.md)**: Data storage abstraction with indexing and retrieval for AI applications. * **[MCP SDK](src/mcp-sdk/README.md)**: SDK for [Model Context Protocol](https://modelcontextprotocol.io) enabling communication between AI agents and tools. + * **[Toolbox](src/tools/README.md)**: Collection of third-party tools for AI agents. * **Bundles** * **[AI Bundle](src/ai-bundle/README.md)**: Symfony integration for AI Platform, Store and Agent components. * **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for MCP SDK, allowing them to act as MCP servers or clients. diff --git a/demo/composer.json b/demo/composer.json index 63c271867..2e5edc558 100644 --- a/demo/composer.json +++ b/demo/composer.json @@ -13,6 +13,7 @@ "php-http/discovery": "^1.20", "runtime/frankenphp-symfony": "^0.2.0", "symfony/ai-bundle": "@dev", + "symfony/ai-tools": "@dev", "symfony/asset": "~7.3.0", "symfony/asset-mapper": "~7.3.0", "symfony/clock": "~7.3.0", diff --git a/demo/config/packages/ai.yaml b/demo/config/packages/ai.yaml index c33e60a9b..0767439e9 100644 --- a/demo/config/packages/ai.yaml +++ b/demo/config/packages/ai.yaml @@ -38,7 +38,7 @@ ai: text: 'Please answer the users question based on Wikipedia and provide a link to the article.' include_tools: true tools: - - 'Symfony\AI\Agent\Toolbox\Tool\Wikipedia' + - 'Symfony\AI\Toolbox\Tool\Wikipedia' audio: model: class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt' @@ -75,14 +75,15 @@ services: autoconfigure: true # Symfony\AI\Agent\Toolbox\Tool\Clock: ~ - # Symfony\AI\Agent\Toolbox\Tool\OpenMeteo: ~ - # Symfony\AI\Agent\Toolbox\Tool\SerpApi: - # $apiKey: '%env(SERP_API_KEY)%' - Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~ Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch: $vectorizer: '@ai.vectorizer.openai' $store: '@ai.store.chroma_db.symfonycon' + # Symfony\AI\Toolbox\Tool\OpenMeteo: ~ + # Symfony\AI\Toolbox\Tool\SerpApi: + # $apiKey: '%env(SERP_API_KEY)%' + Symfony\AI\Toolbox\Tool\Wikipedia: ~ + Symfony\AI\Store\Document\Loader\RssFeedLoader: ~ Symfony\AI\Store\Document\Transformer\TextTrimTransformer: ~ diff --git a/examples/aimlapi/toolcall.php b/examples/aimlapi/toolcall.php index 5895d18dd..db1eaeed2 100644 --- a/examples/aimlapi/toolcall.php +++ b/examples/aimlapi/toolcall.php @@ -11,13 +11,13 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\AiMlApi\Completions; use Symfony\AI\Platform\Bridge\AiMlApi\PlatformFactory; use Symfony\AI\Platform\Capability; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/anthropic/toolcall.php b/examples/anthropic/toolcall.php index 06a37a835..8564fc239 100644 --- a/examples/anthropic/toolcall.php +++ b/examples/anthropic/toolcall.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Anthropic\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/bedrock/toolcall-claude.php b/examples/bedrock/toolcall-claude.php index 16b23403b..f72eca292 100644 --- a/examples/bedrock/toolcall-claude.php +++ b/examples/bedrock/toolcall-claude.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/bedrock/toolcall-nova.php b/examples/bedrock/toolcall-nova.php index 2b361b9f4..fb6215764 100644 --- a/examples/bedrock/toolcall-nova.php +++ b/examples/bedrock/toolcall-nova.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\Bedrock\Nova\Nova; use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/composer.json b/examples/composer.json index d3a4ebda1..d67c3fe20 100644 --- a/examples/composer.json +++ b/examples/composer.json @@ -19,6 +19,7 @@ "symfony/ai-agent": "@dev", "symfony/ai-platform": "@dev", "symfony/ai-store": "@dev", + "symfony/ai-tools": "@dev", "symfony/cache": "^7.3|^8.0", "symfony/console": "^7.3|^8.0", "symfony/css-selector": "^7.3|^8.0", diff --git a/examples/dockermodelrunner/toolcall.php b/examples/dockermodelrunner/toolcall.php index 012cb259f..458736954 100644 --- a/examples/dockermodelrunner/toolcall.php +++ b/examples/dockermodelrunner/toolcall.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\DockerModelRunner\Completions; use Symfony\AI\Platform\Bridge\DockerModelRunner\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/mistral/toolcall-stream.php b/examples/mistral/toolcall-stream.php index b13a54ab7..b8e0f13e1 100644 --- a/examples/mistral/toolcall-stream.php +++ b/examples/mistral/toolcall-stream.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\YouTubeTranscriber; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\Mistral\Mistral; use Symfony\AI\Platform\Bridge\Mistral\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\YouTubeTranscriber; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/openai/toolcall-stream.php b/examples/openai/toolcall-stream.php index bba5bd6d2..dc3d6a748 100644 --- a/examples/openai/toolcall-stream.php +++ b/examples/openai/toolcall-stream.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/openai/toolcall.php b/examples/openai/toolcall.php index a99d9247d..fa735d674 100644 --- a/examples/openai/toolcall.php +++ b/examples/openai/toolcall.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\YouTubeTranscriber; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\YouTubeTranscriber; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/brave.php b/examples/toolbox/brave.php index f0729733e..1d08a2161 100644 --- a/examples/toolbox/brave.php +++ b/examples/toolbox/brave.php @@ -11,13 +11,13 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Brave; use Symfony\AI\Agent\Toolbox\Tool\Crawler; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Brave; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/firecrawl-crawl.php b/examples/toolbox/firecrawl-crawl.php index 041a1c224..5d7104cc5 100644 --- a/examples/toolbox/firecrawl-crawl.php +++ b/examples/toolbox/firecrawl-crawl.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; 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\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Firecrawl; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/firecrawl-map.php b/examples/toolbox/firecrawl-map.php index 7893e97c7..fb161d024 100644 --- a/examples/toolbox/firecrawl-map.php +++ b/examples/toolbox/firecrawl-map.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; 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\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Firecrawl; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/firecrawl-scrape.php b/examples/toolbox/firecrawl-scrape.php index 81da48f59..c4ee3441a 100644 --- a/examples/toolbox/firecrawl-scrape.php +++ b/examples/toolbox/firecrawl-scrape.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; 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\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Firecrawl; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/mapbox-geocode.php b/examples/toolbox/mapbox-geocode.php index 5ed906e3f..8ad476015 100644 --- a/examples/toolbox/mapbox-geocode.php +++ b/examples/toolbox/mapbox-geocode.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Mapbox; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Mapbox; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/mapbox-reverse-geocode.php b/examples/toolbox/mapbox-reverse-geocode.php index d9f14403f..eb1770f04 100644 --- a/examples/toolbox/mapbox-reverse-geocode.php +++ b/examples/toolbox/mapbox-reverse-geocode.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Mapbox; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Mapbox; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/serpapi.php b/examples/toolbox/serpapi.php index 393c3b15e..fbf6aa354 100644 --- a/examples/toolbox/serpapi.php +++ b/examples/toolbox/serpapi.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\SerpApi; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\SerpApi; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/tavily.php b/examples/toolbox/tavily.php index 6e5ec1682..bf44020b9 100644 --- a/examples/toolbox/tavily.php +++ b/examples/toolbox/tavily.php @@ -11,12 +11,12 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; -use Symfony\AI\Agent\Toolbox\Tool\Tavily; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; +use Symfony\AI\Toolbox\Tool\Tavily; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/weather-event.php b/examples/toolbox/weather-event.php index fbd136f07..c3d481cb2 100644 --- a/examples/toolbox/weather-event.php +++ b/examples/toolbox/weather-event.php @@ -12,13 +12,13 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; use Symfony\AI\Agent\Toolbox\Event\ToolCallsExecuted; -use Symfony\AI\Agent\Toolbox\Tool\OpenMeteo; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; use Symfony\AI\Platform\Result\ObjectResult; +use Symfony\AI\Toolbox\Tool\OpenMeteo; use Symfony\Component\EventDispatcher\EventDispatcher; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/src/agent/CHANGELOG.md b/src/agent/CHANGELOG.md index b82ee4f76..8dc7cc713 100644 --- a/src/agent/CHANGELOG.md +++ b/src/agent/CHANGELOG.md @@ -24,14 +24,7 @@ CHANGELOG - `SimilaritySearch` for RAG/vector store searches - `Agent` allowing agents to use other agents as tools - `Clock` for current date/time - - `Brave` for web search integration - `Crawler` for web page crawling - - `Mapbox` for geocoding addresses to coordinates and reverse geocoding - - `OpenMeteo` for weather information - - `SerpApi` for search engine results - - `Tavily` for AI-powered search - - `Wikipedia` for Wikipedia content retrieval - - `YouTubeTranscriber` for YouTube video transcription * Add structured output support: - PHP class output with automatic conversion from LLM responses - Array structure output with JSON schema validation diff --git a/src/tools/.gitattributes b/src/tools/.gitattributes new file mode 100644 index 000000000..6ad0287aa --- /dev/null +++ b/src/tools/.gitattributes @@ -0,0 +1,7 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/AGENTS.md export-ignore +/CLAUDE.md export-ignore +/phpunit.xml.dist export-ignore +/phpstan.dist.neon export-ignore +/tests export-ignore diff --git a/src/tools/AGENTS.md b/src/tools/AGENTS.md new file mode 100644 index 000000000..587fe13fd --- /dev/null +++ b/src/tools/AGENTS.md @@ -0,0 +1,29 @@ +# AGENTS.md + +## AI Agent Tools Package + +This package provides third-party tools for AI agents including: + +- **Brave Search**: Web search functionality using the Brave Search API +- **Firecrawl**: Website scraping, crawling, and URL mapping capabilities +- **Mapbox**: Geocoding and reverse geocoding services +- **OpenMeteo**: Weather data and forecasting services +- **SerpApi**: Internet search functionality via SerpApi +- **Tavily**: Web search and content extraction services +- **Wikipedia**: Search and article retrieval from Wikipedia +- **YouTube Transcriber**: Fetch transcripts from YouTube videos + +### Usage + +These tools can be registered with AI agents to provide external data access capabilities. Each tool is automatically configured with the `#[AsTool]` attribute for easy integration. + +### Requirements + +- PHP 8.2+ +- Various API keys depending on tools used: + - Brave Search API key (for Brave tool) + - Mapbox access token (for Mapbox tool) + - SerpApi key (for SerpApi tool) + - Tavily API key (for Tavily tool) +- HTTP client implementation +- Optional: `mrmysql/youtube-transcript` package (for YouTube Transcriber) \ No newline at end of file diff --git a/src/tools/CHANGELOG.md b/src/tools/CHANGELOG.md new file mode 100644 index 000000000..37e901c6c --- /dev/null +++ b/src/tools/CHANGELOG.md @@ -0,0 +1,14 @@ +CHANGELOG +========= + +0.1 +--- + +- Brave Search tool +- Firecrawl tool +- Mapbox tool +- OpenMeteo tool +- SerpApi tool +- Tavily tool +- Wikipedia tool +- YouTube Transcriber tool \ No newline at end of file diff --git a/src/tools/CLAUDE.md b/src/tools/CLAUDE.md new file mode 100644 index 000000000..bcb46ff02 --- /dev/null +++ b/src/tools/CLAUDE.md @@ -0,0 +1,63 @@ +# CLAUDE.md + +This package provides third-party tools for Symfony AI agents. + +## Available Tools + +### Brave Search Tool +- Provides web search functionality via Brave Search API +- Requires API key configuration +- Returns formatted search results + +### Firecrawl Tool +- Website scraping with `firecrawl_scrape` method +- Website crawling with `firecrawl_crawl` method +- URL mapping with `firecrawl_map` method +- Requires API key and endpoint configuration + +### Mapbox Tool +- Address geocoding with `geocode` method +- Reverse geocoding with `reverse_geocode` method +- Requires Mapbox access token + +### OpenMeteo Tool +- Current weather data with `weather_current` method +- Weather forecasting with `weather_forecast` method +- No API key required (public API) + +### SerpApi Tool +- Internet search functionality via SerpApi +- Requires SerpApi key configuration +- Returns search result titles + +### Tavily Tool +- Web search with `tavily_search` method +- Content extraction with `tavily_extract` method +- Requires Tavily API key + +### Wikipedia Tool +- Searches Wikipedia articles with `wikipedia_search` method +- Retrieves full article content with `wikipedia_article` method +- Supports multiple languages +- No API key required + +### YouTube Transcriber Tool +- Fetches transcripts from YouTube videos +- Requires `mrmysql/youtube-transcript` package +- No API key required + +## Development + +Run tests: +```bash +vendor/bin/phpunit +``` + +Run static analysis: +```bash +vendor/bin/phpstan analyse +``` + +## Tool Integration + +All tools are automatically configured with the `#[AsTool]` attribute and can be easily integrated into AI agents using the agent framework. \ No newline at end of file diff --git a/src/tools/LICENSE b/src/tools/LICENSE new file mode 100644 index 000000000..f35e0bb34 --- /dev/null +++ b/src/tools/LICENSE @@ -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. \ No newline at end of file diff --git a/src/tools/README.md b/src/tools/README.md new file mode 100644 index 000000000..ce4f180a9 --- /dev/null +++ b/src/tools/README.md @@ -0,0 +1,172 @@ +# Symfony AI Toolbox + +A collection of third-party tools for Symfony AI agents. + +## Available Tools + +- [**Brave Search**](#brave-search-tool): Web search functionality using the Brave Search API +- [**Firecrawl**](#firecrawl-tool): Website scraping, crawling, and URL mapping capabilities +- [**Mapbox**](#mapbox-tool): Geocoding and reverse geocoding services +- [**OpenMeteo**](#openmeteo-tool): Weather data and forecasting services +- [**SerpApi**](#serpapi-tool): Internet search functionality via SerpApi +- [**Tavily**](#tavily-tool): Web search and content extraction services +- [**Wikipedia**](#wikipedia-tool): Search and retrieve Wikipedia articles +- [**YouTube Transcriber**](#youtube-transcriber-tool): Fetch transcripts from YouTube videos + +## Installation + +```bash +composer require symfony/ai-tools +``` + +## Usage + +### Brave Search Tool + +```php +use Symfony\AI\Toolbox\Tool\Brave; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$brave = new Brave($httpClient, 'your-brave-api-key'); + +$results = $brave('search query'); +``` + +### Firecrawl Tool + +```php +use Symfony\AI\Toolbox\Tool\Firecrawl; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$firecrawl = new Firecrawl($httpClient, 'your-api-key', 'https://api.firecrawl.dev'); + +// Scrape a single page +$scraped = $firecrawl->scrape('https://example.com'); + +// Crawl an entire website +$crawled = $firecrawl->crawl('https://example.com'); + +// Map all URLs from a website +$mapped = $firecrawl->map('https://example.com'); +``` + +### Mapbox Tool + +```php +use Symfony\AI\Toolbox\Tool\Mapbox; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$mapbox = new Mapbox($httpClient, 'your-mapbox-access-token'); + +// Convert address to coordinates +$coordinates = $mapbox->geocode('1600 Pennsylvania Ave, Washington DC'); + +// Convert coordinates to address +$address = $mapbox->reverseGeocode(-77.0365, 38.8977); +``` + +### OpenMeteo Tool + +```php +use Symfony\AI\Toolbox\Tool\OpenMeteo; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$openMeteo = new OpenMeteo($httpClient); + +// Get current weather +$currentWeather = $openMeteo->current(52.52, 13.4050); // Berlin coordinates + +// Get weather forecast +$forecast = $openMeteo->forecast(52.52, 13.4050); // Berlin coordinates +``` + +### SerpApi Tool + +```php +use Symfony\AI\Toolbox\Tool\SerpApi; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$serpApi = new SerpApi($httpClient, 'your-serpapi-key'); + +$results = $serpApi('artificial intelligence trends'); +``` + +### Tavily Tool + +```php +use Symfony\AI\Toolbox\Tool\Tavily; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$tavily = new Tavily($httpClient, 'your-tavily-api-key'); + +// Search for information +$searchResults = $tavily->search('latest AI developments'); + +// Extract content from a website +$extractedContent = $tavily->extract(['https://example.com']); +``` + +### Wikipedia Tool + +```php +use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$wikipedia = new Wikipedia($httpClient); + +// Search for articles +$searchResults = $wikipedia->search('artificial intelligence'); + +// Get article content +$article = $wikipedia->article('Artificial intelligence'); + +// Use different language (optional) +$germanWikipedia = new Wikipedia($httpClient, 'de'); +``` + +### YouTube Transcriber Tool + +```php +use Symfony\AI\Toolbox\Tool\YouTubeTranscriber; +use Symfony\Component\HttpClient\HttpClient; + +$httpClient = HttpClient::create(); +$transcriber = new YouTubeTranscriber($httpClient); + +// Get transcript from YouTube video ID +$transcript = $transcriber('dQw4w9WgXcQ'); +``` + +## Requirements + +- PHP 8.2 or higher +- Symfony HTTP Client +- API keys for specific tools: + - Brave Search API key (for Brave tool) + - Firecrawl API key and endpoint (for Firecrawl tool) + - Mapbox access token (for Mapbox tool) + - SerpApi key (for SerpApi tool) + - Tavily API key (for Tavily tool) +- Optional dependencies: + - `mrmysql/youtube-transcript` package (for YouTube Transcriber tool) + +**Note**: OpenMeteo and Wikipedia tools require no API keys. + +## Testing + +```bash +vendor/bin/phpunit +``` + +## Static Analysis + +```bash +vendor/bin/phpstan analyse +``` \ No newline at end of file diff --git a/src/tools/composer.json b/src/tools/composer.json new file mode 100644 index 000000000..9c9facf82 --- /dev/null +++ b/src/tools/composer.json @@ -0,0 +1,53 @@ +{ + "name": "symfony/ai-tools", + "description": "Collection of third-party tools for AI agents", + "license": "MIT", + "type": "library", + "keywords": [ + "ai", + "tools", + "brave", + "wikipedia" + ], + "authors": [ + { + "name": "Christopher Hertel", + "email": "mail@christopher-hertel.de" + }, + { + "name": "Oskar Stark", + "email": "oskarstark@googlemail.com" + } + ], + "require": { + "php": ">=8.2", + "symfony/ai-agent": "@dev", + "symfony/ai-platform": "@dev", + "symfony/http-client": "^7.3|^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^2.1.17", + "phpunit/phpunit": "^11.5" + }, + "autoload": { + "psr-4": { + "Symfony\\AI\\Toolbox\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Symfony\\AI\\PHPStan\\": "../../.phpstan/", + "Symfony\\AI\\Toolbox\\Tests\\": "tests/" + } + }, + "config": { + "sort-packages": true + }, + "extra": { + "thanks": { + "name": "symfony/ai", + "url": "https://github.com/symfony/ai" + } + }, + "minimum-stability": "dev" +} diff --git a/src/tools/doc/index.rst b/src/tools/doc/index.rst new file mode 100644 index 000000000..8f95dd965 --- /dev/null +++ b/src/tools/doc/index.rst @@ -0,0 +1,125 @@ +Symfony AI - Toolbox +=================== + +The Toolbox component provides a collection of third-party tools for AI agents, including web search and knowledge retrieval capabilities. + +Installation +------------ + +Install the component using Composer: + +.. code-block:: terminal + + $ composer require symfony/ai-tools + +Available Tools +--------------- + +The Toolbox component includes ready-to-use tools that can be integrated with AI agents: + +Brave Search Tool +~~~~~~~~~~~~~~~~~ + +Provides web search functionality using the Brave Search API:: + + use Symfony\AI\Toolbox\Tool\Brave; + use Symfony\Component\HttpClient\HttpClient; + + $httpClient = HttpClient::create(); + $brave = new Brave($httpClient, 'your-brave-api-key'); + + // Search the web + $results = $brave('latest news about Symfony'); + +The Brave tool returns an array of search results with title, description, and URL for each result. + +**Configuration Options** + +You can pass additional options to customize the search behavior:: + + $brave = new Brave($httpClient, $apiKey, [ + 'country' => 'US', + 'safesearch' => 'moderate', + 'freshness' => 'pw', // Past week + ]); + +See the `Brave Search API documentation`_ for all available options. + +Wikipedia Tool +~~~~~~~~~~~~~~ + +Provides search and article retrieval from Wikipedia:: + + use Symfony\AI\Toolbox\Tool\Wikipedia; + use Symfony\Component\HttpClient\HttpClient; + + $httpClient = HttpClient::create(); + $wikipedia = new Wikipedia($httpClient); + + // Search for articles + $searchResults = $wikipedia->search('artificial intelligence'); + + // Get article content + $article = $wikipedia->article('Artificial intelligence'); + +The Wikipedia tool supports multiple languages by passing a locale parameter:: + + $wikipedia = new Wikipedia($httpClient, 'de'); // German Wikipedia + +**Tool Methods** + +The Wikipedia tool provides two methods that can be used as separate tools: + +* ``search``: Search for articles by query +* ``article``: Retrieve full article content by title + +Agent Integration +----------------- + +These tools are designed to work with the `Agent Component`_ and can be registered using the ``#[AsTool]`` attribute:: + + use Symfony\AI\Agent\Agent; + use Symfony\AI\Agent\Toolbox\AgentProcessor; + use Symfony\AI\Agent\Toolbox\Toolbox; + use Symfony\AI\Toolbox\Tool\Brave; + use Symfony\AI\Toolbox\Tool\Wikipedia; + + // Initialize HTTP client and tools + $httpClient = HttpClient::create(); + $brave = new Brave($httpClient, $braveApiKey); + $wikipedia = new Wikipedia($httpClient); + + // Create toolbox and processor + $toolbox = new Toolbox([$brave, $wikipedia]); + $processor = new AgentProcessor($toolbox); + + // Create agent with tools + $agent = new Agent($platform, $model, [$processor], [$processor]); + +Tool Configuration +------------------ + +Each tool is automatically configured with the ``#[AsTool]`` attribute: + +* **Brave Search**: Registered as ``brave_search`` tool +* **Wikipedia Search**: Registered as ``wikipedia_search`` tool +* **Wikipedia Article**: Registered as ``wikipedia_article`` tool + +Requirements +------------ + +* PHP 8.2 or higher +* Symfony HTTP Client component +* Brave Search API key (for Brave tool only) + +The Wikipedia tool requires no API key as it uses the public Wikipedia API. + +**Code Examples** + +* `Brave Search Example`_ +* `Wikipedia Search Example`_ + +.. _`Brave Search API documentation`: https://api-dashboard.search.brave.com/app/documentation/web-search/query +.. _`Agent Component`: https://github.com/symfony/ai-agent +.. _`Brave Search Example`: https://github.com/symfony/ai/blob/main/examples/toolbox/brave.php +.. _`Wikipedia Search Example`: https://github.com/symfony/ai/blob/main/examples/toolbox/wikipedia.php \ No newline at end of file diff --git a/src/tools/phpstan.dist.neon b/src/tools/phpstan.dist.neon new file mode 100644 index 000000000..facacee5d --- /dev/null +++ b/src/tools/phpstan.dist.neon @@ -0,0 +1,12 @@ +includes: + - ../../.phpstan/extension.neon + +parameters: + level: 6 + paths: + - src/ + - tests/ + treatPhpDocTypesAsCertain: false + ignoreErrors: + - + message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#" \ No newline at end of file diff --git a/src/tools/phpunit.xml.dist b/src/tools/phpunit.xml.dist new file mode 100644 index 000000000..7c04fa4fb --- /dev/null +++ b/src/tools/phpunit.xml.dist @@ -0,0 +1,24 @@ + + + + + tests + + + + + + src + + + diff --git a/src/agent/src/Toolbox/Tool/Brave.php b/src/tools/src/Tool/Brave.php similarity index 98% rename from src/agent/src/Toolbox/Tool/Brave.php rename to src/tools/src/Tool/Brave.php index f0c01d1e0..9a09b3975 100644 --- a/src/agent/src/Toolbox/Tool/Brave.php +++ b/src/tools/src/Tool/Brave.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/agent/src/Toolbox/Tool/Firecrawl.php b/src/tools/src/Tool/Firecrawl.php similarity index 98% rename from src/agent/src/Toolbox/Tool/Firecrawl.php rename to src/tools/src/Tool/Firecrawl.php index ec5f2570c..4f61c1719 100644 --- a/src/agent/src/Toolbox/Tool/Firecrawl.php +++ b/src/tools/src/Tool/Firecrawl.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/agent/src/Toolbox/Tool/Mapbox.php b/src/tools/src/Tool/Mapbox.php similarity index 99% rename from src/agent/src/Toolbox/Tool/Mapbox.php rename to src/tools/src/Tool/Mapbox.php index 8caefd85c..9926ebdc9 100644 --- a/src/agent/src/Toolbox/Tool/Mapbox.php +++ b/src/tools/src/Tool/Mapbox.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/agent/src/Toolbox/Tool/OpenMeteo.php b/src/tools/src/Tool/OpenMeteo.php similarity index 99% rename from src/agent/src/Toolbox/Tool/OpenMeteo.php rename to src/tools/src/Tool/OpenMeteo.php index 6283614a9..22a09ef2d 100644 --- a/src/agent/src/Toolbox/Tool/OpenMeteo.php +++ b/src/tools/src/Tool/OpenMeteo.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/agent/src/Toolbox/Tool/SerpApi.php b/src/tools/src/Tool/SerpApi.php similarity index 97% rename from src/agent/src/Toolbox/Tool/SerpApi.php rename to src/tools/src/Tool/SerpApi.php index aa04e4424..b35178b00 100644 --- a/src/agent/src/Toolbox/Tool/SerpApi.php +++ b/src/tools/src/Tool/SerpApi.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/agent/src/Toolbox/Tool/Tavily.php b/src/tools/src/Tool/Tavily.php similarity index 97% rename from src/agent/src/Toolbox/Tool/Tavily.php rename to src/tools/src/Tool/Tavily.php index 36405b42e..91196222c 100644 --- a/src/agent/src/Toolbox/Tool/Tavily.php +++ b/src/tools/src/Tool/Tavily.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/agent/src/Toolbox/Tool/Wikipedia.php b/src/tools/src/Tool/Wikipedia.php similarity index 98% rename from src/agent/src/Toolbox/Tool/Wikipedia.php rename to src/tools/src/Tool/Wikipedia.php index 8cf85e4a7..11b34f036 100644 --- a/src/agent/src/Toolbox/Tool/Wikipedia.php +++ b/src/tools/src/Tool/Wikipedia.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/agent/src/Toolbox/Tool/YouTubeTranscriber.php b/src/tools/src/Tool/YouTubeTranscriber.php similarity index 97% rename from src/agent/src/Toolbox/Tool/YouTubeTranscriber.php rename to src/tools/src/Tool/YouTubeTranscriber.php index be81d1096..6c4dd907b 100644 --- a/src/agent/src/Toolbox/Tool/YouTubeTranscriber.php +++ b/src/tools/src/Tool/YouTubeTranscriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tool; use MrMySQL\YoutubeTranscript\TranscriptListFetcher; use Symfony\AI\Agent\Exception\LogicException; diff --git a/src/agent/tests/Toolbox/Tool/BraveTest.php b/src/tools/tests/Tool/BraveTest.php similarity index 90% rename from src/agent/tests/Toolbox/Tool/BraveTest.php rename to src/tools/tests/Tool/BraveTest.php index d84444503..dacc879df 100644 --- a/src/agent/tests/Toolbox/Tool/BraveTest.php +++ b/src/tools/tests/Tool/BraveTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Tests\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Agent\Toolbox\Tool\Brave; +use Symfony\AI\Toolbox\Tool\Brave; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; use Symfony\Component\HttpClient\Response\MockResponse; @@ -23,7 +23,7 @@ final class BraveTest extends TestCase { public function testReturnsSearchResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/brave.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/brave/brave.json'); $httpClient = new MockHttpClient($result); $brave = new Brave($httpClient, 'test-api-key'); @@ -40,7 +40,7 @@ public function testReturnsSearchResults() public function testPassesCorrectParametersToApi() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/brave.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/brave/brave.json'); $httpClient = new MockHttpClient($result); $brave = new Brave($httpClient, 'test-api-key', ['extra' => 'option']); diff --git a/src/agent/tests/Toolbox/Tool/FirecrawlTest.php b/src/tools/tests/Tool/FirecrawlTest.php similarity index 74% rename from src/agent/tests/Toolbox/Tool/FirecrawlTest.php rename to src/tools/tests/Tool/FirecrawlTest.php index 90ae79838..2e1134087 100644 --- a/src/agent/tests/Toolbox/Tool/FirecrawlTest.php +++ b/src/tools/tests/Tool/FirecrawlTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Tests\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Agent\Toolbox\Tool\Firecrawl; +use Symfony\AI\Toolbox\Tool\Firecrawl; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -23,7 +23,7 @@ final class FirecrawlTest extends TestCase public function testScrape() { $httpClient = new MockHttpClient([ - JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-scrape.json'), + JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-scrape.json'), ]); $firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002'); @@ -39,10 +39,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/Tool/firecrawl/firecrawl-crawl-wait.json'), + JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl-status.json'), + JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl-status-done.json'), + JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl.json'), ]); $firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002'); @@ -62,7 +62,7 @@ public function testCrawl() public function testMap() { $httpClient = new MockHttpClient([ - JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/firecrawl-map.json'), + JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-map.json'), ]); $firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002'); diff --git a/src/agent/tests/Toolbox/Tool/MapboxTest.php b/src/tools/tests/Tool/MapboxTest.php similarity index 87% rename from src/agent/tests/Toolbox/Tool/MapboxTest.php rename to src/tools/tests/Tool/MapboxTest.php index 4a6093cbe..28e79b334 100644 --- a/src/agent/tests/Toolbox/Tool/MapboxTest.php +++ b/src/tools/tests/Tool/MapboxTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Tests\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Agent\Toolbox\Tool\Mapbox; +use Symfony\AI\Toolbox\Tool\Mapbox; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -22,7 +22,7 @@ final class MapboxTest extends TestCase { public function testGeocodeWithSingleResult() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/mapbox-geocode-single.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-geocode-single.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -48,7 +48,7 @@ public function testGeocodeWithSingleResult() public function testGeocodeWithMultipleResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/mapbox-geocode-multiple.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-geocode-multiple.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -83,7 +83,7 @@ public function testGeocodeWithMultipleResults() public function testGeocodeWithNoResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/mapbox-geocode-empty.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-geocode-empty.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -99,7 +99,7 @@ public function testGeocodeWithNoResults() public function testReverseGeocodeWithValidCoordinates() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/mapbox-reverse-geocode.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-reverse-geocode.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -141,7 +141,7 @@ public function testReverseGeocodeWithValidCoordinates() public function testReverseGeocodeWithNoResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/mapbox-reverse-geocode-empty.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-reverse-geocode-empty.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); diff --git a/src/agent/tests/Toolbox/Tool/OpenMeteoTest.php b/src/tools/tests/Tool/OpenMeteoTest.php similarity index 86% rename from src/agent/tests/Toolbox/Tool/OpenMeteoTest.php rename to src/tools/tests/Tool/OpenMeteoTest.php index 364ad55e8..42131f5b1 100644 --- a/src/agent/tests/Toolbox/Tool/OpenMeteoTest.php +++ b/src/tools/tests/Tool/OpenMeteoTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Tests\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Agent\Toolbox\Tool\OpenMeteo; +use Symfony\AI\Toolbox\Tool\OpenMeteo; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -22,7 +22,7 @@ final class OpenMeteoTest extends TestCase { public function testCurrent() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/openmeteo-current.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/openmeteo/openmeteo-current.json'); $httpClient = new MockHttpClient($result); $openMeteo = new OpenMeteo($httpClient); @@ -40,7 +40,7 @@ public function testCurrent() public function testForecast() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/openmeteo-forecast.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/openmeteo/openmeteo-forecast.json'); $httpClient = new MockHttpClient($result); $openMeteo = new OpenMeteo($httpClient); diff --git a/src/agent/tests/Toolbox/Tool/WikipediaTest.php b/src/tools/tests/Tool/WikipediaTest.php similarity index 85% rename from src/agent/tests/Toolbox/Tool/WikipediaTest.php rename to src/tools/tests/Tool/WikipediaTest.php index 9bc20c311..f828b1d5d 100644 --- a/src/agent/tests/Toolbox/Tool/WikipediaTest.php +++ b/src/tools/tests/Tool/WikipediaTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Agent\Tests\Toolbox\Tool; +namespace Symfony\AI\Toolbox\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; +use Symfony\AI\Toolbox\Tool\Wikipedia; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -22,7 +22,7 @@ final class WikipediaTest extends TestCase { public function testSearchWithResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/wikipedia-search-result.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-search-result.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -49,7 +49,7 @@ public function testSearchWithResults() public function testSearchWithoutResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/wikipedia-search-empty.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-search-empty.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -62,7 +62,7 @@ public function testSearchWithoutResults() public function testArticleWithResult() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/wikipedia-article.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-article.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -78,7 +78,7 @@ public function testArticleWithResult() public function testArticleWithRedirect() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/wikipedia-article-redirect.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-article-redirect.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -96,7 +96,7 @@ public function testArticleWithRedirect() public function testArticleMissing() { - $result = JsonMockResponse::fromFile(__DIR__.'/../../fixtures/Tool/wikipedia-article-missing.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-article-missing.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); diff --git a/src/agent/tests/fixtures/Tool/brave.json b/src/tools/tests/fixtures/Tool/brave/brave.json similarity index 100% rename from src/agent/tests/fixtures/Tool/brave.json rename to src/tools/tests/fixtures/Tool/brave/brave.json diff --git a/src/agent/tests/fixtures/Tool/firecrawl-crawl-status-done.json b/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status-done.json similarity index 100% rename from src/agent/tests/fixtures/Tool/firecrawl-crawl-status-done.json rename to src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status-done.json diff --git a/src/agent/tests/fixtures/Tool/firecrawl-crawl-status.json b/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status.json similarity index 100% rename from src/agent/tests/fixtures/Tool/firecrawl-crawl-status.json rename to src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status.json diff --git a/src/agent/tests/fixtures/Tool/firecrawl-crawl-wait.json b/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-wait.json similarity index 100% rename from src/agent/tests/fixtures/Tool/firecrawl-crawl-wait.json rename to src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-wait.json diff --git a/src/agent/tests/fixtures/Tool/firecrawl-crawl.json b/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl.json similarity index 100% rename from src/agent/tests/fixtures/Tool/firecrawl-crawl.json rename to src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl.json diff --git a/src/agent/tests/fixtures/Tool/firecrawl-map.json b/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-map.json similarity index 100% rename from src/agent/tests/fixtures/Tool/firecrawl-map.json rename to src/tools/tests/fixtures/Tool/firecrawl/firecrawl-map.json diff --git a/src/agent/tests/fixtures/Tool/firecrawl-scrape.json b/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-scrape.json similarity index 100% rename from src/agent/tests/fixtures/Tool/firecrawl-scrape.json rename to src/tools/tests/fixtures/Tool/firecrawl/firecrawl-scrape.json diff --git a/src/agent/tests/fixtures/Tool/mapbox-geocode-empty.json b/src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-empty.json similarity index 100% rename from src/agent/tests/fixtures/Tool/mapbox-geocode-empty.json rename to src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-empty.json diff --git a/src/agent/tests/fixtures/Tool/mapbox-geocode-multiple.json b/src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-multiple.json similarity index 100% rename from src/agent/tests/fixtures/Tool/mapbox-geocode-multiple.json rename to src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-multiple.json diff --git a/src/agent/tests/fixtures/Tool/mapbox-geocode-single.json b/src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-single.json similarity index 100% rename from src/agent/tests/fixtures/Tool/mapbox-geocode-single.json rename to src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-single.json diff --git a/src/agent/tests/fixtures/Tool/mapbox-reverse-geocode-empty.json b/src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode-empty.json similarity index 100% rename from src/agent/tests/fixtures/Tool/mapbox-reverse-geocode-empty.json rename to src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode-empty.json diff --git a/src/agent/tests/fixtures/Tool/mapbox-reverse-geocode.json b/src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode.json similarity index 100% rename from src/agent/tests/fixtures/Tool/mapbox-reverse-geocode.json rename to src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode.json diff --git a/src/agent/tests/fixtures/Tool/openmeteo-current.json b/src/tools/tests/fixtures/Tool/openmeteo/openmeteo-current.json similarity index 100% rename from src/agent/tests/fixtures/Tool/openmeteo-current.json rename to src/tools/tests/fixtures/Tool/openmeteo/openmeteo-current.json diff --git a/src/agent/tests/fixtures/Tool/openmeteo-forecast.json b/src/tools/tests/fixtures/Tool/openmeteo/openmeteo-forecast.json similarity index 100% rename from src/agent/tests/fixtures/Tool/openmeteo-forecast.json rename to src/tools/tests/fixtures/Tool/openmeteo/openmeteo-forecast.json diff --git a/src/agent/tests/fixtures/Tool/wikipedia-article-missing.json b/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-missing.json similarity index 100% rename from src/agent/tests/fixtures/Tool/wikipedia-article-missing.json rename to src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-missing.json diff --git a/src/agent/tests/fixtures/Tool/wikipedia-article-redirect.json b/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-redirect.json similarity index 100% rename from src/agent/tests/fixtures/Tool/wikipedia-article-redirect.json rename to src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-redirect.json diff --git a/src/agent/tests/fixtures/Tool/wikipedia-article.json b/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article.json similarity index 100% rename from src/agent/tests/fixtures/Tool/wikipedia-article.json rename to src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article.json diff --git a/src/agent/tests/fixtures/Tool/wikipedia-search-empty.json b/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-empty.json similarity index 100% rename from src/agent/tests/fixtures/Tool/wikipedia-search-empty.json rename to src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-empty.json diff --git a/src/agent/tests/fixtures/Tool/wikipedia-search-result.json b/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-result.json similarity index 100% rename from src/agent/tests/fixtures/Tool/wikipedia-search-result.json rename to src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-result.json From 2e758401fda1444562a34f7022478e243c8c5dfa Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 08:21:06 +0200 Subject: [PATCH 02/11] Update component name from Toolbox to Tools in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 221028c91..09bacb8ae 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Symfony AI consists of several lower and higher level **components** and the res * **[Agent](src/agent/README.md)**: Framework for building AI agents that can interact with users and perform tasks. * **[Store](src/store/README.md)**: Data storage abstraction with indexing and retrieval for AI applications. * **[MCP SDK](src/mcp-sdk/README.md)**: SDK for [Model Context Protocol](https://modelcontextprotocol.io) enabling communication between AI agents and tools. - * **[Toolbox](src/tools/README.md)**: Collection of third-party tools for AI agents. + * **[Tools](src/tools/README.md)**: Collection of third-party tools for AI agents. * **Bundles** * **[AI Bundle](src/ai-bundle/README.md)**: Symfony integration for AI Platform, Store and Agent components. * **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for MCP SDK, allowing them to act as MCP servers or clients. From 6958cb5f6a1f062abb4211a49c5f141e8417c4ef Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 08:25:45 +0200 Subject: [PATCH 03/11] Update namespaces from Symfony\AI\Toolbox to Symfony\AI\Tools - Update PSR-4 autoloading configuration in composer.json - Update all PHP source files and test files to use new namespace - Update documentation titles and examples - Update example files and demo configuration - Fix agent documentation to use correct AsTool attribute namespace --- demo/config/packages/ai.yaml | 8 ++++---- examples/aimlapi/toolcall.php | 2 +- examples/anthropic/toolcall.php | 2 +- examples/bedrock/toolcall-claude.php | 2 +- examples/bedrock/toolcall-nova.php | 2 +- examples/dockermodelrunner/toolcall.php | 2 +- examples/mistral/toolcall-stream.php | 2 +- examples/openai/toolcall-stream.php | 2 +- examples/openai/toolcall.php | 2 +- examples/toolbox/brave.php | 2 +- examples/toolbox/firecrawl-crawl.php | 2 +- examples/toolbox/firecrawl-map.php | 2 +- examples/toolbox/firecrawl-scrape.php | 2 +- examples/toolbox/mapbox-geocode.php | 2 +- examples/toolbox/mapbox-reverse-geocode.php | 2 +- examples/toolbox/serpapi.php | 2 +- examples/toolbox/tavily.php | 2 +- examples/toolbox/weather-event.php | 2 +- src/agent/doc/index.rst | 4 ++-- src/tools/README.md | 18 +++++++++--------- src/tools/composer.json | 4 ++-- src/tools/doc/index.rst | 12 ++++++------ src/tools/src/Tool/Brave.php | 2 +- src/tools/src/Tool/Firecrawl.php | 2 +- src/tools/src/Tool/Mapbox.php | 2 +- src/tools/src/Tool/OpenMeteo.php | 2 +- src/tools/src/Tool/SerpApi.php | 2 +- src/tools/src/Tool/Tavily.php | 2 +- src/tools/src/Tool/Wikipedia.php | 2 +- src/tools/src/Tool/YouTubeTranscriber.php | 2 +- src/tools/tests/Tool/BraveTest.php | 4 ++-- src/tools/tests/Tool/FirecrawlTest.php | 4 ++-- src/tools/tests/Tool/MapboxTest.php | 4 ++-- src/tools/tests/Tool/OpenMeteoTest.php | 4 ++-- src/tools/tests/Tool/WikipediaTest.php | 4 ++-- 35 files changed, 58 insertions(+), 58 deletions(-) diff --git a/demo/config/packages/ai.yaml b/demo/config/packages/ai.yaml index 0767439e9..ba35dcea0 100644 --- a/demo/config/packages/ai.yaml +++ b/demo/config/packages/ai.yaml @@ -38,7 +38,7 @@ ai: text: 'Please answer the users question based on Wikipedia and provide a link to the article.' include_tools: true tools: - - 'Symfony\AI\Toolbox\Tool\Wikipedia' + - 'Symfony\AI\Tools\Tool\Wikipedia' audio: model: class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt' @@ -79,10 +79,10 @@ services: $vectorizer: '@ai.vectorizer.openai' $store: '@ai.store.chroma_db.symfonycon' - # Symfony\AI\Toolbox\Tool\OpenMeteo: ~ - # Symfony\AI\Toolbox\Tool\SerpApi: + # Symfony\AI\Tools\Tool\OpenMeteo: ~ + # Symfony\AI\Tools\Tool\SerpApi: # $apiKey: '%env(SERP_API_KEY)%' - Symfony\AI\Toolbox\Tool\Wikipedia: ~ + Symfony\AI\Tools\Tool\Wikipedia: ~ Symfony\AI\Store\Document\Loader\RssFeedLoader: ~ Symfony\AI\Store\Document\Transformer\TextTrimTransformer: ~ diff --git a/examples/aimlapi/toolcall.php b/examples/aimlapi/toolcall.php index db1eaeed2..142612db7 100644 --- a/examples/aimlapi/toolcall.php +++ b/examples/aimlapi/toolcall.php @@ -17,7 +17,7 @@ use Symfony\AI\Platform\Capability; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/anthropic/toolcall.php b/examples/anthropic/toolcall.php index 8564fc239..237ac195c 100644 --- a/examples/anthropic/toolcall.php +++ b/examples/anthropic/toolcall.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\Anthropic\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/bedrock/toolcall-claude.php b/examples/bedrock/toolcall-claude.php index f72eca292..a69679324 100644 --- a/examples/bedrock/toolcall-claude.php +++ b/examples/bedrock/toolcall-claude.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/bedrock/toolcall-nova.php b/examples/bedrock/toolcall-nova.php index fb6215764..b45df42a8 100644 --- a/examples/bedrock/toolcall-nova.php +++ b/examples/bedrock/toolcall-nova.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/dockermodelrunner/toolcall.php b/examples/dockermodelrunner/toolcall.php index 458736954..64662ef19 100644 --- a/examples/dockermodelrunner/toolcall.php +++ b/examples/dockermodelrunner/toolcall.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\DockerModelRunner\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/mistral/toolcall-stream.php b/examples/mistral/toolcall-stream.php index b8e0f13e1..419a75dcd 100644 --- a/examples/mistral/toolcall-stream.php +++ b/examples/mistral/toolcall-stream.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\Mistral\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\YouTubeTranscriber; +use Symfony\AI\Tools\Tool\YouTubeTranscriber; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/openai/toolcall-stream.php b/examples/openai/toolcall-stream.php index dc3d6a748..bd82d93b5 100644 --- a/examples/openai/toolcall-stream.php +++ b/examples/openai/toolcall-stream.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/openai/toolcall.php b/examples/openai/toolcall.php index fa735d674..963f015b5 100644 --- a/examples/openai/toolcall.php +++ b/examples/openai/toolcall.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\YouTubeTranscriber; +use Symfony\AI\Tools\Tool\YouTubeTranscriber; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/brave.php b/examples/toolbox/brave.php index 1d08a2161..3029daa44 100644 --- a/examples/toolbox/brave.php +++ b/examples/toolbox/brave.php @@ -17,7 +17,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Brave; +use Symfony\AI\Tools\Tool\Brave; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/firecrawl-crawl.php b/examples/toolbox/firecrawl-crawl.php index 5d7104cc5..51977daef 100644 --- a/examples/toolbox/firecrawl-crawl.php +++ b/examples/toolbox/firecrawl-crawl.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Firecrawl; +use Symfony\AI\Tools\Tool\Firecrawl; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/firecrawl-map.php b/examples/toolbox/firecrawl-map.php index fb161d024..b3779cd18 100644 --- a/examples/toolbox/firecrawl-map.php +++ b/examples/toolbox/firecrawl-map.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Firecrawl; +use Symfony\AI\Tools\Tool\Firecrawl; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/firecrawl-scrape.php b/examples/toolbox/firecrawl-scrape.php index c4ee3441a..512fab17e 100644 --- a/examples/toolbox/firecrawl-scrape.php +++ b/examples/toolbox/firecrawl-scrape.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Firecrawl; +use Symfony\AI\Tools\Tool\Firecrawl; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/mapbox-geocode.php b/examples/toolbox/mapbox-geocode.php index 8ad476015..efeaeb4ab 100644 --- a/examples/toolbox/mapbox-geocode.php +++ b/examples/toolbox/mapbox-geocode.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Mapbox; +use Symfony\AI\Tools\Tool\Mapbox; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/mapbox-reverse-geocode.php b/examples/toolbox/mapbox-reverse-geocode.php index eb1770f04..40f6de33b 100644 --- a/examples/toolbox/mapbox-reverse-geocode.php +++ b/examples/toolbox/mapbox-reverse-geocode.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Mapbox; +use Symfony\AI\Tools\Tool\Mapbox; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/serpapi.php b/examples/toolbox/serpapi.php index fbf6aa354..6883d017c 100644 --- a/examples/toolbox/serpapi.php +++ b/examples/toolbox/serpapi.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\SerpApi; +use Symfony\AI\Tools\Tool\SerpApi; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/tavily.php b/examples/toolbox/tavily.php index bf44020b9..fb94d4440 100644 --- a/examples/toolbox/tavily.php +++ b/examples/toolbox/tavily.php @@ -16,7 +16,7 @@ use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; -use Symfony\AI\Toolbox\Tool\Tavily; +use Symfony\AI\Tools\Tool\Tavily; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/examples/toolbox/weather-event.php b/examples/toolbox/weather-event.php index c3d481cb2..96f4ecd2f 100644 --- a/examples/toolbox/weather-event.php +++ b/examples/toolbox/weather-event.php @@ -18,7 +18,7 @@ use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; use Symfony\AI\Platform\Result\ObjectResult; -use Symfony\AI\Toolbox\Tool\OpenMeteo; +use Symfony\AI\Tools\Tool\OpenMeteo; use Symfony\Component\EventDispatcher\EventDispatcher; require_once dirname(__DIR__).'/bootstrap.php'; diff --git a/src/agent/doc/index.rst b/src/agent/doc/index.rst index 103987c12..8eb5146c3 100644 --- a/src/agent/doc/index.rst +++ b/src/agent/doc/index.rst @@ -77,7 +77,7 @@ Tool calling can be enabled by registering the processors in the agent:: Custom tools can basically be any class, but must configure by the ``#[AsTool]`` attribute:: - use Symfony\AI\Toolbox\Attribute\AsTool; + use Symfony\AI\Agent\Toolbox\Attribute\AsTool; #[AsTool('company_name', 'Provides the name of your company')] final class CompanyName @@ -97,7 +97,7 @@ JsonSerializable interface, to JSON strings for you. So you can return arrays or You can configure the method to be called by the LLM with the #[AsTool] attribute and have multiple tools per class:: - use Symfony\AI\Toolbox\Attribute\AsTool; + use Symfony\AI\Agent\Toolbox\Attribute\AsTool; #[AsTool( name: 'weather_current', diff --git a/src/tools/README.md b/src/tools/README.md index ce4f180a9..926e805f6 100644 --- a/src/tools/README.md +++ b/src/tools/README.md @@ -1,4 +1,4 @@ -# Symfony AI Toolbox +# Symfony AI Tools A collection of third-party tools for Symfony AI agents. @@ -24,7 +24,7 @@ composer require symfony/ai-tools ### Brave Search Tool ```php -use Symfony\AI\Toolbox\Tool\Brave; +use Symfony\AI\Tools\Tool\Brave; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -36,7 +36,7 @@ $results = $brave('search query'); ### Firecrawl Tool ```php -use Symfony\AI\Toolbox\Tool\Firecrawl; +use Symfony\AI\Tools\Tool\Firecrawl; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -55,7 +55,7 @@ $mapped = $firecrawl->map('https://example.com'); ### Mapbox Tool ```php -use Symfony\AI\Toolbox\Tool\Mapbox; +use Symfony\AI\Tools\Tool\Mapbox; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -71,7 +71,7 @@ $address = $mapbox->reverseGeocode(-77.0365, 38.8977); ### OpenMeteo Tool ```php -use Symfony\AI\Toolbox\Tool\OpenMeteo; +use Symfony\AI\Tools\Tool\OpenMeteo; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -87,7 +87,7 @@ $forecast = $openMeteo->forecast(52.52, 13.4050); // Berlin coordinates ### SerpApi Tool ```php -use Symfony\AI\Toolbox\Tool\SerpApi; +use Symfony\AI\Tools\Tool\SerpApi; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -99,7 +99,7 @@ $results = $serpApi('artificial intelligence trends'); ### Tavily Tool ```php -use Symfony\AI\Toolbox\Tool\Tavily; +use Symfony\AI\Tools\Tool\Tavily; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -115,7 +115,7 @@ $extractedContent = $tavily->extract(['https://example.com']); ### Wikipedia Tool ```php -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -134,7 +134,7 @@ $germanWikipedia = new Wikipedia($httpClient, 'de'); ### YouTube Transcriber Tool ```php -use Symfony\AI\Toolbox\Tool\YouTubeTranscriber; +use Symfony\AI\Tools\Tool\YouTubeTranscriber; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); diff --git a/src/tools/composer.json b/src/tools/composer.json index 9c9facf82..1b4036130 100644 --- a/src/tools/composer.json +++ b/src/tools/composer.json @@ -31,13 +31,13 @@ }, "autoload": { "psr-4": { - "Symfony\\AI\\Toolbox\\": "src/" + "Symfony\\AI\\Tools\\": "src/" } }, "autoload-dev": { "psr-4": { "Symfony\\AI\\PHPStan\\": "../../.phpstan/", - "Symfony\\AI\\Toolbox\\Tests\\": "tests/" + "Symfony\\AI\\Tools\\Tests\\": "tests/" } }, "config": { diff --git a/src/tools/doc/index.rst b/src/tools/doc/index.rst index 8f95dd965..9c84af6d4 100644 --- a/src/tools/doc/index.rst +++ b/src/tools/doc/index.rst @@ -1,7 +1,7 @@ -Symfony AI - Toolbox +Symfony AI - Tools =================== -The Toolbox component provides a collection of third-party tools for AI agents, including web search and knowledge retrieval capabilities. +The Tools component provides a collection of third-party tools for AI agents, including web search and knowledge retrieval capabilities. Installation ------------ @@ -22,7 +22,7 @@ Brave Search Tool Provides web search functionality using the Brave Search API:: - use Symfony\AI\Toolbox\Tool\Brave; + use Symfony\AI\Tools\Tool\Brave; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -50,7 +50,7 @@ Wikipedia Tool Provides search and article retrieval from Wikipedia:: - use Symfony\AI\Toolbox\Tool\Wikipedia; + use Symfony\AI\Tools\Tool\Wikipedia; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -81,8 +81,8 @@ These tools are designed to work with the `Agent Component`_ and can be register use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; use Symfony\AI\Agent\Toolbox\Toolbox; - use Symfony\AI\Toolbox\Tool\Brave; - use Symfony\AI\Toolbox\Tool\Wikipedia; + use Symfony\AI\Tools\Tool\Brave; + use Symfony\AI\Tools\Tool\Wikipedia; // Initialize HTTP client and tools $httpClient = HttpClient::create(); diff --git a/src/tools/src/Tool/Brave.php b/src/tools/src/Tool/Brave.php index 9a09b3975..ee319c601 100644 --- a/src/tools/src/Tool/Brave.php +++ b/src/tools/src/Tool/Brave.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/tools/src/Tool/Firecrawl.php b/src/tools/src/Tool/Firecrawl.php index 4f61c1719..c4705bb35 100644 --- a/src/tools/src/Tool/Firecrawl.php +++ b/src/tools/src/Tool/Firecrawl.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/Mapbox.php b/src/tools/src/Tool/Mapbox.php index 9926ebdc9..7b8873b00 100644 --- a/src/tools/src/Tool/Mapbox.php +++ b/src/tools/src/Tool/Mapbox.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/tools/src/Tool/OpenMeteo.php b/src/tools/src/Tool/OpenMeteo.php index 22a09ef2d..2dea2867f 100644 --- a/src/tools/src/Tool/OpenMeteo.php +++ b/src/tools/src/Tool/OpenMeteo.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/tools/src/Tool/SerpApi.php b/src/tools/src/Tool/SerpApi.php index b35178b00..5f49fad5f 100644 --- a/src/tools/src/Tool/SerpApi.php +++ b/src/tools/src/Tool/SerpApi.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/Tavily.php b/src/tools/src/Tool/Tavily.php index 91196222c..a283f2cb9 100644 --- a/src/tools/src/Tool/Tavily.php +++ b/src/tools/src/Tool/Tavily.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/Wikipedia.php b/src/tools/src/Tool/Wikipedia.php index 11b34f036..aa55ba862 100644 --- a/src/tools/src/Tool/Wikipedia.php +++ b/src/tools/src/Tool/Wikipedia.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/YouTubeTranscriber.php b/src/tools/src/Tool/YouTubeTranscriber.php index 6c4dd907b..84e4023b7 100644 --- a/src/tools/src/Tool/YouTubeTranscriber.php +++ b/src/tools/src/Tool/YouTubeTranscriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tool; +namespace Symfony\AI\Tools\Tool; use MrMySQL\YoutubeTranscript\TranscriptListFetcher; use Symfony\AI\Agent\Exception\LogicException; diff --git a/src/tools/tests/Tool/BraveTest.php b/src/tools/tests/Tool/BraveTest.php index dacc879df..6c8794dea 100644 --- a/src/tools/tests/Tool/BraveTest.php +++ b/src/tools/tests/Tool/BraveTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tests\Tool; +namespace Symfony\AI\Tools\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Toolbox\Tool\Brave; +use Symfony\AI\Tools\Tool\Brave; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; use Symfony\Component\HttpClient\Response\MockResponse; diff --git a/src/tools/tests/Tool/FirecrawlTest.php b/src/tools/tests/Tool/FirecrawlTest.php index 2e1134087..5660549f5 100644 --- a/src/tools/tests/Tool/FirecrawlTest.php +++ b/src/tools/tests/Tool/FirecrawlTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tests\Tool; +namespace Symfony\AI\Tools\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Toolbox\Tool\Firecrawl; +use Symfony\AI\Tools\Tool\Firecrawl; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; diff --git a/src/tools/tests/Tool/MapboxTest.php b/src/tools/tests/Tool/MapboxTest.php index 28e79b334..ee33b08db 100644 --- a/src/tools/tests/Tool/MapboxTest.php +++ b/src/tools/tests/Tool/MapboxTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tests\Tool; +namespace Symfony\AI\Tools\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Toolbox\Tool\Mapbox; +use Symfony\AI\Tools\Tool\Mapbox; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; diff --git a/src/tools/tests/Tool/OpenMeteoTest.php b/src/tools/tests/Tool/OpenMeteoTest.php index 42131f5b1..1e85e46dd 100644 --- a/src/tools/tests/Tool/OpenMeteoTest.php +++ b/src/tools/tests/Tool/OpenMeteoTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tests\Tool; +namespace Symfony\AI\Tools\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Toolbox\Tool\OpenMeteo; +use Symfony\AI\Tools\Tool\OpenMeteo; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; diff --git a/src/tools/tests/Tool/WikipediaTest.php b/src/tools/tests/Tool/WikipediaTest.php index f828b1d5d..d553f32eb 100644 --- a/src/tools/tests/Tool/WikipediaTest.php +++ b/src/tools/tests/Tool/WikipediaTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Toolbox\Tests\Tool; +namespace Symfony\AI\Tools\Tests\Tool; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Toolbox\Tool\Wikipedia; +use Symfony\AI\Tools\Tool\Wikipedia; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; From af24a4a90c75eb14bc47c544a7ca432c1f782a76 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 08:28:00 +0200 Subject: [PATCH 04/11] Add 'Add' prefix to changelog tool entries --- src/tools/CHANGELOG.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/CHANGELOG.md b/src/tools/CHANGELOG.md index 37e901c6c..dbfa82b1b 100644 --- a/src/tools/CHANGELOG.md +++ b/src/tools/CHANGELOG.md @@ -4,11 +4,11 @@ CHANGELOG 0.1 --- -- Brave Search tool -- Firecrawl tool -- Mapbox tool -- OpenMeteo tool -- SerpApi tool -- Tavily tool -- Wikipedia tool -- YouTube Transcriber tool \ No newline at end of file +- Add Brave Search tool +- Add Firecrawl tool +- Add Mapbox tool +- Add OpenMeteo tool +- Add SerpApi tool +- Add Tavily tool +- Add Wikipedia tool +- Add YouTube Transcriber tool \ No newline at end of file From 539cf230eb9c7e5758852a2f2b48259136d10311 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 08:28:55 +0200 Subject: [PATCH 05/11] Reorder Tools component between Agent and Store in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09bacb8ae..5a69f6db4 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ Symfony AI consists of several lower and higher level **components** and the res * **Components** * **[Platform](src/platform/README.md)**: A unified interface to various AI platforms like OpenAI, Anthropic, Azure, Gemini, VertexAI, and more. * **[Agent](src/agent/README.md)**: Framework for building AI agents that can interact with users and perform tasks. + * **[Tools](src/tools/README.md)**: Collection of third-party tools for AI agents. * **[Store](src/store/README.md)**: Data storage abstraction with indexing and retrieval for AI applications. * **[MCP SDK](src/mcp-sdk/README.md)**: SDK for [Model Context Protocol](https://modelcontextprotocol.io) enabling communication between AI agents and tools. - * **[Tools](src/tools/README.md)**: Collection of third-party tools for AI agents. * **Bundles** * **[AI Bundle](src/ai-bundle/README.md)**: Symfony integration for AI Platform, Store and Agent components. * **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for MCP SDK, allowing them to act as MCP servers or clients. From 99a32cbc2e51802250e745e78a4ba9cfa7fbc7e1 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 08:31:39 +0200 Subject: [PATCH 06/11] Fix tool namespaces in AI Bundle documentation Update tool service references from Symfony\AI\Agent\Toolbox\Tool to Symfony\AI\Tools\Tool for moved third-party tools: - Wikipedia, OpenMeteo, SerpApi, Tavily, YouTubeTranscriber, Firecrawl, Brave Keep agent-specific tools (Clock, SimilaritySearch) in original namespace. --- src/ai-bundle/doc/index.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ai-bundle/doc/index.rst b/src/ai-bundle/doc/index.rst index 0d867a839..6897fabb7 100644 --- a/src/ai-bundle/doc/index.rst +++ b/src/ai-bundle/doc/index.rst @@ -95,7 +95,7 @@ Configuration class: 'Symfony\AI\Platform\Bridge\Anthropic\Claude' name: !php/const Symfony\AI\Platform\Bridge\Anthropic\Claude::SONNET_37 tools: # If undefined, all tools are injected into the agent, use "tools: false" to disable tools. - - 'Symfony\AI\Agent\Toolbox\Tool\Wikipedia' + - 'Symfony\AI\Tools\Tool\Wikipedia' fault_tolerant_toolbox: false # Disables fault tolerant toolbox, default is true search_agent: platform: 'ai.platform.perplexity' @@ -408,18 +408,18 @@ To use existing tools, you can register them as a service: autoconfigure: true Symfony\AI\Agent\Toolbox\Tool\Clock: ~ - Symfony\AI\Agent\Toolbox\Tool\OpenMeteo: ~ - Symfony\AI\Agent\Toolbox\Tool\SerpApi: + Symfony\AI\Tools\Tool\OpenMeteo: ~ + Symfony\AI\Tools\Tool\SerpApi: $apiKey: '%env(SERP_API_KEY)%' Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch: ~ - Symfony\AI\Agent\Toolbox\Tool\Tavily: + Symfony\AI\Tools\Tool\Tavily: $apiKey: '%env(TAVILY_API_KEY)%' - Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~ - Symfony\AI\Agent\Toolbox\Tool\YouTubeTranscriber: ~ - Symfony\AI\Agent\Toolbox\Tool\Firecrawl: + Symfony\AI\Tools\Tool\Wikipedia: ~ + Symfony\AI\Tools\Tool\YouTubeTranscriber: ~ + Symfony\AI\Tools\Tool\Firecrawl: $endpoint: '%env(FIRECRAWL_ENDPOINT)%' $apiKey: '%env(FIRECRAWL_API_KEY)%' - Symfony\AI\Agent\Toolbox\Tool\Brave: + Symfony\AI\Tools\Tool\Brave: $apiKey: '%env(BRAVE_API_KEY)%' Custom tools can be registered by using the ``#[AsTool]`` attribute:: From 7cc5ed02ae3d696e58d1d921cadee269f30fa7e5 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 10:00:02 +0200 Subject: [PATCH 07/11] Add newline at EOF to src/tools/phpstan.dist.neon --- src/tools/phpstan.dist.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/phpstan.dist.neon b/src/tools/phpstan.dist.neon index facacee5d..988f6c4d0 100644 --- a/src/tools/phpstan.dist.neon +++ b/src/tools/phpstan.dist.neon @@ -9,4 +9,4 @@ parameters: treatPhpDocTypesAsCertain: false ignoreErrors: - - message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#" \ No newline at end of file + message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#" From 7f25484361cfe3693c0c3ae9c9bd6e8f8c2b54ed Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 10:01:15 +0200 Subject: [PATCH 08/11] Add PHPStan ignore for missingType.iterableValue in tests --- src/tools/phpstan.dist.neon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/phpstan.dist.neon b/src/tools/phpstan.dist.neon index 988f6c4d0..087b39901 100644 --- a/src/tools/phpstan.dist.neon +++ b/src/tools/phpstan.dist.neon @@ -10,3 +10,6 @@ parameters: ignoreErrors: - message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#" + - + identifier: missingType.iterableValue + path: tests/* From f834a6b8b459368e2f2be49dfba7750ac47ad92e Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 10:02:16 +0200 Subject: [PATCH 09/11] Update testsuite name to symfony/ai-tools in phpunit.xml.dist --- src/tools/phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/phpunit.xml.dist b/src/tools/phpunit.xml.dist index 7c04fa4fb..2563d38d6 100644 --- a/src/tools/phpunit.xml.dist +++ b/src/tools/phpunit.xml.dist @@ -11,7 +11,7 @@ failOnRisky="true" failOnWarning="true"> - + tests From 7319daf95be3fe72e0431ae8f0e037ab2a3508e0 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 10:04:43 +0200 Subject: [PATCH 10/11] Remove moved third-party tools from AI Bundle documentation Remove references to tools that have been moved to symfony/ai-tools: - Wikipedia, OpenMeteo, SerpApi, Tavily, YouTubeTranscriber, Firecrawl, Brave, Mapbox Keep only agent-provided tools: - Clock, SimilaritySearch Update example to use SimilaritySearch instead of Wikipedia tool. --- src/ai-bundle/doc/index.rst | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/ai-bundle/doc/index.rst b/src/ai-bundle/doc/index.rst index 6897fabb7..8b4156938 100644 --- a/src/ai-bundle/doc/index.rst +++ b/src/ai-bundle/doc/index.rst @@ -87,15 +87,15 @@ Configuration # Referencing a agent => agent in agent 🤯 - agent: 'research' - name: 'wikipedia_research' - description: 'Can research on Wikipedia' + name: 'similarity_research' + description: 'Can search through stored documents' research: platform: 'ai.platform.anthropic' model: class: 'Symfony\AI\Platform\Bridge\Anthropic\Claude' name: !php/const Symfony\AI\Platform\Bridge\Anthropic\Claude::SONNET_37 tools: # If undefined, all tools are injected into the agent, use "tools: false" to disable tools. - - 'Symfony\AI\Tools\Tool\Wikipedia' + - 'Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch' fault_tolerant_toolbox: false # Disables fault tolerant toolbox, default is true search_agent: platform: 'ai.platform.perplexity' @@ -408,19 +408,7 @@ To use existing tools, you can register them as a service: autoconfigure: true Symfony\AI\Agent\Toolbox\Tool\Clock: ~ - Symfony\AI\Tools\Tool\OpenMeteo: ~ - Symfony\AI\Tools\Tool\SerpApi: - $apiKey: '%env(SERP_API_KEY)%' Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch: ~ - Symfony\AI\Tools\Tool\Tavily: - $apiKey: '%env(TAVILY_API_KEY)%' - Symfony\AI\Tools\Tool\Wikipedia: ~ - Symfony\AI\Tools\Tool\YouTubeTranscriber: ~ - Symfony\AI\Tools\Tool\Firecrawl: - $endpoint: '%env(FIRECRAWL_ENDPOINT)%' - $apiKey: '%env(FIRECRAWL_API_KEY)%' - Symfony\AI\Tools\Tool\Brave: - $apiKey: '%env(BRAVE_API_KEY)%' Custom tools can be registered by using the ``#[AsTool]`` attribute:: From 14224c29f9fc367c198fb012f0d0183840198f0f Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 18 Sep 2025 11:41:33 +0200 Subject: [PATCH 11/11] Simplify namespace structure and flatten fixture directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove Tool subnamespace from Symfony\AI\Tools\Tool to Symfony\AI\Tools - Move tool classes from src/Tool/ to src/ directory - Move test files from tests/Tool/ to tests/ directory - Flatten fixture directory structure by removing tool subdirectories - Update all use statements and fixture paths across codebase - Update examples, documentation, and configuration files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/tools/README.md | 16 ++++++++-------- src/tools/doc/index.rst | 8 ++++---- src/tools/src/{Tool => }/Brave.php | 2 +- src/tools/src/{Tool => }/Firecrawl.php | 2 +- src/tools/src/{Tool => }/Mapbox.php | 2 +- src/tools/src/{Tool => }/OpenMeteo.php | 2 +- src/tools/src/{Tool => }/SerpApi.php | 2 +- src/tools/src/{Tool => }/Tavily.php | 2 +- src/tools/src/{Tool => }/Wikipedia.php | 2 +- src/tools/src/{Tool => }/YouTubeTranscriber.php | 2 +- src/tools/tests/{Tool => }/BraveTest.php | 8 ++++---- src/tools/tests/{Tool => }/FirecrawlTest.php | 16 ++++++++-------- src/tools/tests/{Tool => }/MapboxTest.php | 14 +++++++------- src/tools/tests/{Tool => }/OpenMeteoTest.php | 8 ++++---- src/tools/tests/{Tool => }/WikipediaTest.php | 14 +++++++------- .../tests/fixtures/{Tool/brave => }/brave.json | 0 .../firecrawl-crawl-status-done.json | 0 .../firecrawl => }/firecrawl-crawl-status.json | 0 .../firecrawl => }/firecrawl-crawl-wait.json | 0 .../{Tool/firecrawl => }/firecrawl-crawl.json | 0 .../{Tool/firecrawl => }/firecrawl-map.json | 0 .../{Tool/firecrawl => }/firecrawl-scrape.json | 0 .../{Tool/mapbox => }/mapbox-geocode-empty.json | 0 .../mapbox => }/mapbox-geocode-multiple.json | 0 .../{Tool/mapbox => }/mapbox-geocode-single.json | 0 .../mapbox-reverse-geocode-empty.json | 0 .../mapbox => }/mapbox-reverse-geocode.json | 0 .../{Tool/openmeteo => }/openmeteo-current.json | 0 .../{Tool/openmeteo => }/openmeteo-forecast.json | 0 .../wikipedia-article-missing.json | 0 .../wikipedia-article-redirect.json | 0 .../{Tool/wikipedia => }/wikipedia-article.json | 0 .../wikipedia => }/wikipedia-search-empty.json | 0 .../wikipedia => }/wikipedia-search-result.json | 0 34 files changed, 50 insertions(+), 50 deletions(-) rename src/tools/src/{Tool => }/Brave.php (98%) rename src/tools/src/{Tool => }/Firecrawl.php (99%) rename src/tools/src/{Tool => }/Mapbox.php (99%) rename src/tools/src/{Tool => }/OpenMeteo.php (99%) rename src/tools/src/{Tool => }/SerpApi.php (97%) rename src/tools/src/{Tool => }/Tavily.php (98%) rename src/tools/src/{Tool => }/Wikipedia.php (98%) rename src/tools/src/{Tool => }/YouTubeTranscriber.php (97%) rename src/tools/tests/{Tool => }/BraveTest.php (90%) rename src/tools/tests/{Tool => }/FirecrawlTest.php (74%) rename src/tools/tests/{Tool => }/MapboxTest.php (87%) rename src/tools/tests/{Tool => }/OpenMeteoTest.php (86%) rename src/tools/tests/{Tool => }/WikipediaTest.php (85%) rename src/tools/tests/fixtures/{Tool/brave => }/brave.json (100%) rename src/tools/tests/fixtures/{Tool/firecrawl => }/firecrawl-crawl-status-done.json (100%) rename src/tools/tests/fixtures/{Tool/firecrawl => }/firecrawl-crawl-status.json (100%) rename src/tools/tests/fixtures/{Tool/firecrawl => }/firecrawl-crawl-wait.json (100%) rename src/tools/tests/fixtures/{Tool/firecrawl => }/firecrawl-crawl.json (100%) rename src/tools/tests/fixtures/{Tool/firecrawl => }/firecrawl-map.json (100%) rename src/tools/tests/fixtures/{Tool/firecrawl => }/firecrawl-scrape.json (100%) rename src/tools/tests/fixtures/{Tool/mapbox => }/mapbox-geocode-empty.json (100%) rename src/tools/tests/fixtures/{Tool/mapbox => }/mapbox-geocode-multiple.json (100%) rename src/tools/tests/fixtures/{Tool/mapbox => }/mapbox-geocode-single.json (100%) rename src/tools/tests/fixtures/{Tool/mapbox => }/mapbox-reverse-geocode-empty.json (100%) rename src/tools/tests/fixtures/{Tool/mapbox => }/mapbox-reverse-geocode.json (100%) rename src/tools/tests/fixtures/{Tool/openmeteo => }/openmeteo-current.json (100%) rename src/tools/tests/fixtures/{Tool/openmeteo => }/openmeteo-forecast.json (100%) rename src/tools/tests/fixtures/{Tool/wikipedia => }/wikipedia-article-missing.json (100%) rename src/tools/tests/fixtures/{Tool/wikipedia => }/wikipedia-article-redirect.json (100%) rename src/tools/tests/fixtures/{Tool/wikipedia => }/wikipedia-article.json (100%) rename src/tools/tests/fixtures/{Tool/wikipedia => }/wikipedia-search-empty.json (100%) rename src/tools/tests/fixtures/{Tool/wikipedia => }/wikipedia-search-result.json (100%) diff --git a/src/tools/README.md b/src/tools/README.md index 926e805f6..4370f4759 100644 --- a/src/tools/README.md +++ b/src/tools/README.md @@ -24,7 +24,7 @@ composer require symfony/ai-tools ### Brave Search Tool ```php -use Symfony\AI\Tools\Tool\Brave; +use Symfony\AI\Tools\Brave; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -36,7 +36,7 @@ $results = $brave('search query'); ### Firecrawl Tool ```php -use Symfony\AI\Tools\Tool\Firecrawl; +use Symfony\AI\Tools\Firecrawl; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -55,7 +55,7 @@ $mapped = $firecrawl->map('https://example.com'); ### Mapbox Tool ```php -use Symfony\AI\Tools\Tool\Mapbox; +use Symfony\AI\Tools\Mapbox; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -71,7 +71,7 @@ $address = $mapbox->reverseGeocode(-77.0365, 38.8977); ### OpenMeteo Tool ```php -use Symfony\AI\Tools\Tool\OpenMeteo; +use Symfony\AI\Tools\OpenMeteo; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -87,7 +87,7 @@ $forecast = $openMeteo->forecast(52.52, 13.4050); // Berlin coordinates ### SerpApi Tool ```php -use Symfony\AI\Tools\Tool\SerpApi; +use Symfony\AI\Tools\SerpApi; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -99,7 +99,7 @@ $results = $serpApi('artificial intelligence trends'); ### Tavily Tool ```php -use Symfony\AI\Tools\Tool\Tavily; +use Symfony\AI\Tools\Tavily; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -115,7 +115,7 @@ $extractedContent = $tavily->extract(['https://example.com']); ### Wikipedia Tool ```php -use Symfony\AI\Tools\Tool\Wikipedia; +use Symfony\AI\Tools\Wikipedia; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -134,7 +134,7 @@ $germanWikipedia = new Wikipedia($httpClient, 'de'); ### YouTube Transcriber Tool ```php -use Symfony\AI\Tools\Tool\YouTubeTranscriber; +use Symfony\AI\Tools\YouTubeTranscriber; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); diff --git a/src/tools/doc/index.rst b/src/tools/doc/index.rst index 9c84af6d4..de47b2ea7 100644 --- a/src/tools/doc/index.rst +++ b/src/tools/doc/index.rst @@ -22,7 +22,7 @@ Brave Search Tool Provides web search functionality using the Brave Search API:: - use Symfony\AI\Tools\Tool\Brave; + use Symfony\AI\Tools\Brave; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -50,7 +50,7 @@ Wikipedia Tool Provides search and article retrieval from Wikipedia:: - use Symfony\AI\Tools\Tool\Wikipedia; + use Symfony\AI\Tools\Wikipedia; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create(); @@ -81,8 +81,8 @@ These tools are designed to work with the `Agent Component`_ and can be register use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; use Symfony\AI\Agent\Toolbox\Toolbox; - use Symfony\AI\Tools\Tool\Brave; - use Symfony\AI\Tools\Tool\Wikipedia; + use Symfony\AI\Tools\Brave; + use Symfony\AI\Tools\Wikipedia; // Initialize HTTP client and tools $httpClient = HttpClient::create(); diff --git a/src/tools/src/Tool/Brave.php b/src/tools/src/Brave.php similarity index 98% rename from src/tools/src/Tool/Brave.php rename to src/tools/src/Brave.php index ee319c601..91af658d9 100644 --- a/src/tools/src/Tool/Brave.php +++ b/src/tools/src/Brave.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/tools/src/Tool/Firecrawl.php b/src/tools/src/Firecrawl.php similarity index 99% rename from src/tools/src/Tool/Firecrawl.php rename to src/tools/src/Firecrawl.php index c4705bb35..8b22906d6 100644 --- a/src/tools/src/Tool/Firecrawl.php +++ b/src/tools/src/Firecrawl.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/Mapbox.php b/src/tools/src/Mapbox.php similarity index 99% rename from src/tools/src/Tool/Mapbox.php rename to src/tools/src/Mapbox.php index 7b8873b00..0cf69ac4c 100644 --- a/src/tools/src/Tool/Mapbox.php +++ b/src/tools/src/Mapbox.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/tools/src/Tool/OpenMeteo.php b/src/tools/src/OpenMeteo.php similarity index 99% rename from src/tools/src/Tool/OpenMeteo.php rename to src/tools/src/OpenMeteo.php index 2dea2867f..a67ff2d67 100644 --- a/src/tools/src/Tool/OpenMeteo.php +++ b/src/tools/src/OpenMeteo.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\AI\Platform\Contract\JsonSchema\Attribute\With; diff --git a/src/tools/src/Tool/SerpApi.php b/src/tools/src/SerpApi.php similarity index 97% rename from src/tools/src/Tool/SerpApi.php rename to src/tools/src/SerpApi.php index 5f49fad5f..191b2dd81 100644 --- a/src/tools/src/Tool/SerpApi.php +++ b/src/tools/src/SerpApi.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/Tavily.php b/src/tools/src/Tavily.php similarity index 98% rename from src/tools/src/Tool/Tavily.php rename to src/tools/src/Tavily.php index a283f2cb9..d26974763 100644 --- a/src/tools/src/Tool/Tavily.php +++ b/src/tools/src/Tavily.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/Wikipedia.php b/src/tools/src/Wikipedia.php similarity index 98% rename from src/tools/src/Tool/Wikipedia.php rename to src/tools/src/Wikipedia.php index aa55ba862..791623fa5 100644 --- a/src/tools/src/Tool/Wikipedia.php +++ b/src/tools/src/Wikipedia.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use Symfony\AI\Agent\Toolbox\Attribute\AsTool; use Symfony\Contracts\HttpClient\HttpClientInterface; diff --git a/src/tools/src/Tool/YouTubeTranscriber.php b/src/tools/src/YouTubeTranscriber.php similarity index 97% rename from src/tools/src/Tool/YouTubeTranscriber.php rename to src/tools/src/YouTubeTranscriber.php index 84e4023b7..7ee308b59 100644 --- a/src/tools/src/Tool/YouTubeTranscriber.php +++ b/src/tools/src/YouTubeTranscriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tool; +namespace Symfony\AI\Tools; use MrMySQL\YoutubeTranscript\TranscriptListFetcher; use Symfony\AI\Agent\Exception\LogicException; diff --git a/src/tools/tests/Tool/BraveTest.php b/src/tools/tests/BraveTest.php similarity index 90% rename from src/tools/tests/Tool/BraveTest.php rename to src/tools/tests/BraveTest.php index 6c8794dea..31c62d7e9 100644 --- a/src/tools/tests/Tool/BraveTest.php +++ b/src/tools/tests/BraveTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tests\Tool; +namespace Symfony\AI\Tools\Tests; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Tools\Tool\Brave; +use Symfony\AI\Tools\Brave; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; use Symfony\Component\HttpClient\Response\MockResponse; @@ -23,7 +23,7 @@ final class BraveTest extends TestCase { public function testReturnsSearchResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/brave/brave.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/brave.json'); $httpClient = new MockHttpClient($result); $brave = new Brave($httpClient, 'test-api-key'); @@ -40,7 +40,7 @@ public function testReturnsSearchResults() public function testPassesCorrectParametersToApi() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/brave/brave.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/brave.json'); $httpClient = new MockHttpClient($result); $brave = new Brave($httpClient, 'test-api-key', ['extra' => 'option']); diff --git a/src/tools/tests/Tool/FirecrawlTest.php b/src/tools/tests/FirecrawlTest.php similarity index 74% rename from src/tools/tests/Tool/FirecrawlTest.php rename to src/tools/tests/FirecrawlTest.php index 5660549f5..14c9ff026 100644 --- a/src/tools/tests/Tool/FirecrawlTest.php +++ b/src/tools/tests/FirecrawlTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tests\Tool; +namespace Symfony\AI\Tools\Tests; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Tools\Tool\Firecrawl; +use Symfony\AI\Tools\Firecrawl; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -23,7 +23,7 @@ final class FirecrawlTest extends TestCase public function testScrape() { $httpClient = new MockHttpClient([ - JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-scrape.json'), + JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-scrape.json'), ]); $firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002'); @@ -39,10 +39,10 @@ public function testScrape() public function testCrawl() { $httpClient = new MockHttpClient([ - JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl-wait.json'), - JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl-status.json'), - JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl-status-done.json'), - JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-crawl.json'), + JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl-wait.json'), + JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl-status.json'), + JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl-status-done.json'), + JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl.json'), ]); $firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002'); @@ -62,7 +62,7 @@ public function testCrawl() public function testMap() { $httpClient = new MockHttpClient([ - JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/firecrawl/firecrawl-map.json'), + JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-map.json'), ]); $firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002'); diff --git a/src/tools/tests/Tool/MapboxTest.php b/src/tools/tests/MapboxTest.php similarity index 87% rename from src/tools/tests/Tool/MapboxTest.php rename to src/tools/tests/MapboxTest.php index ee33b08db..b6f33a619 100644 --- a/src/tools/tests/Tool/MapboxTest.php +++ b/src/tools/tests/MapboxTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tests\Tool; +namespace Symfony\AI\Tools\Tests; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Tools\Tool\Mapbox; +use Symfony\AI\Tools\Mapbox; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -22,7 +22,7 @@ final class MapboxTest extends TestCase { public function testGeocodeWithSingleResult() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-geocode-single.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-geocode-single.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -48,7 +48,7 @@ public function testGeocodeWithSingleResult() public function testGeocodeWithMultipleResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-geocode-multiple.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-geocode-multiple.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -83,7 +83,7 @@ public function testGeocodeWithMultipleResults() public function testGeocodeWithNoResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-geocode-empty.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-geocode-empty.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -99,7 +99,7 @@ public function testGeocodeWithNoResults() public function testReverseGeocodeWithValidCoordinates() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-reverse-geocode.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-reverse-geocode.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); @@ -141,7 +141,7 @@ public function testReverseGeocodeWithValidCoordinates() public function testReverseGeocodeWithNoResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/mapbox/mapbox-reverse-geocode-empty.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-reverse-geocode-empty.json'); $httpClient = new MockHttpClient($result); $mapbox = new Mapbox($httpClient, 'test_token'); diff --git a/src/tools/tests/Tool/OpenMeteoTest.php b/src/tools/tests/OpenMeteoTest.php similarity index 86% rename from src/tools/tests/Tool/OpenMeteoTest.php rename to src/tools/tests/OpenMeteoTest.php index 1e85e46dd..ff30d90ce 100644 --- a/src/tools/tests/Tool/OpenMeteoTest.php +++ b/src/tools/tests/OpenMeteoTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tests\Tool; +namespace Symfony\AI\Tools\Tests; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Tools\Tool\OpenMeteo; +use Symfony\AI\Tools\OpenMeteo; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -22,7 +22,7 @@ final class OpenMeteoTest extends TestCase { public function testCurrent() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/openmeteo/openmeteo-current.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/openmeteo-current.json'); $httpClient = new MockHttpClient($result); $openMeteo = new OpenMeteo($httpClient); @@ -40,7 +40,7 @@ public function testCurrent() public function testForecast() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/openmeteo/openmeteo-forecast.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/openmeteo-forecast.json'); $httpClient = new MockHttpClient($result); $openMeteo = new OpenMeteo($httpClient); diff --git a/src/tools/tests/Tool/WikipediaTest.php b/src/tools/tests/WikipediaTest.php similarity index 85% rename from src/tools/tests/Tool/WikipediaTest.php rename to src/tools/tests/WikipediaTest.php index d553f32eb..e506814be 100644 --- a/src/tools/tests/Tool/WikipediaTest.php +++ b/src/tools/tests/WikipediaTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\AI\Tools\Tests\Tool; +namespace Symfony\AI\Tools\Tests; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use Symfony\AI\Tools\Tool\Wikipedia; +use Symfony\AI\Tools\Wikipedia; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\JsonMockResponse; @@ -22,7 +22,7 @@ final class WikipediaTest extends TestCase { public function testSearchWithResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-search-result.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-search-result.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -49,7 +49,7 @@ public function testSearchWithResults() public function testSearchWithoutResults() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-search-empty.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-search-empty.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -62,7 +62,7 @@ public function testSearchWithoutResults() public function testArticleWithResult() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-article.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-article.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -78,7 +78,7 @@ public function testArticleWithResult() public function testArticleWithRedirect() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-article-redirect.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-article-redirect.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); @@ -96,7 +96,7 @@ public function testArticleWithRedirect() public function testArticleMissing() { - $result = JsonMockResponse::fromFile(__DIR__.'/../fixtures/Tool/wikipedia/wikipedia-article-missing.json'); + $result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-article-missing.json'); $httpClient = new MockHttpClient($result); $wikipedia = new Wikipedia($httpClient); diff --git a/src/tools/tests/fixtures/Tool/brave/brave.json b/src/tools/tests/fixtures/brave.json similarity index 100% rename from src/tools/tests/fixtures/Tool/brave/brave.json rename to src/tools/tests/fixtures/brave.json diff --git a/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status-done.json b/src/tools/tests/fixtures/firecrawl-crawl-status-done.json similarity index 100% rename from src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status-done.json rename to src/tools/tests/fixtures/firecrawl-crawl-status-done.json diff --git a/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status.json b/src/tools/tests/fixtures/firecrawl-crawl-status.json similarity index 100% rename from src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-status.json rename to src/tools/tests/fixtures/firecrawl-crawl-status.json diff --git a/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-wait.json b/src/tools/tests/fixtures/firecrawl-crawl-wait.json similarity index 100% rename from src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl-wait.json rename to src/tools/tests/fixtures/firecrawl-crawl-wait.json diff --git a/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl.json b/src/tools/tests/fixtures/firecrawl-crawl.json similarity index 100% rename from src/tools/tests/fixtures/Tool/firecrawl/firecrawl-crawl.json rename to src/tools/tests/fixtures/firecrawl-crawl.json diff --git a/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-map.json b/src/tools/tests/fixtures/firecrawl-map.json similarity index 100% rename from src/tools/tests/fixtures/Tool/firecrawl/firecrawl-map.json rename to src/tools/tests/fixtures/firecrawl-map.json diff --git a/src/tools/tests/fixtures/Tool/firecrawl/firecrawl-scrape.json b/src/tools/tests/fixtures/firecrawl-scrape.json similarity index 100% rename from src/tools/tests/fixtures/Tool/firecrawl/firecrawl-scrape.json rename to src/tools/tests/fixtures/firecrawl-scrape.json diff --git a/src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-empty.json b/src/tools/tests/fixtures/mapbox-geocode-empty.json similarity index 100% rename from src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-empty.json rename to src/tools/tests/fixtures/mapbox-geocode-empty.json diff --git a/src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-multiple.json b/src/tools/tests/fixtures/mapbox-geocode-multiple.json similarity index 100% rename from src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-multiple.json rename to src/tools/tests/fixtures/mapbox-geocode-multiple.json diff --git a/src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-single.json b/src/tools/tests/fixtures/mapbox-geocode-single.json similarity index 100% rename from src/tools/tests/fixtures/Tool/mapbox/mapbox-geocode-single.json rename to src/tools/tests/fixtures/mapbox-geocode-single.json diff --git a/src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode-empty.json b/src/tools/tests/fixtures/mapbox-reverse-geocode-empty.json similarity index 100% rename from src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode-empty.json rename to src/tools/tests/fixtures/mapbox-reverse-geocode-empty.json diff --git a/src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode.json b/src/tools/tests/fixtures/mapbox-reverse-geocode.json similarity index 100% rename from src/tools/tests/fixtures/Tool/mapbox/mapbox-reverse-geocode.json rename to src/tools/tests/fixtures/mapbox-reverse-geocode.json diff --git a/src/tools/tests/fixtures/Tool/openmeteo/openmeteo-current.json b/src/tools/tests/fixtures/openmeteo-current.json similarity index 100% rename from src/tools/tests/fixtures/Tool/openmeteo/openmeteo-current.json rename to src/tools/tests/fixtures/openmeteo-current.json diff --git a/src/tools/tests/fixtures/Tool/openmeteo/openmeteo-forecast.json b/src/tools/tests/fixtures/openmeteo-forecast.json similarity index 100% rename from src/tools/tests/fixtures/Tool/openmeteo/openmeteo-forecast.json rename to src/tools/tests/fixtures/openmeteo-forecast.json diff --git a/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-missing.json b/src/tools/tests/fixtures/wikipedia-article-missing.json similarity index 100% rename from src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-missing.json rename to src/tools/tests/fixtures/wikipedia-article-missing.json diff --git a/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-redirect.json b/src/tools/tests/fixtures/wikipedia-article-redirect.json similarity index 100% rename from src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article-redirect.json rename to src/tools/tests/fixtures/wikipedia-article-redirect.json diff --git a/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article.json b/src/tools/tests/fixtures/wikipedia-article.json similarity index 100% rename from src/tools/tests/fixtures/Tool/wikipedia/wikipedia-article.json rename to src/tools/tests/fixtures/wikipedia-article.json diff --git a/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-empty.json b/src/tools/tests/fixtures/wikipedia-search-empty.json similarity index 100% rename from src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-empty.json rename to src/tools/tests/fixtures/wikipedia-search-empty.json diff --git a/src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-result.json b/src/tools/tests/fixtures/wikipedia-search-result.json similarity index 100% rename from src/tools/tests/fixtures/Tool/wikipedia/wikipedia-search-result.json rename to src/tools/tests/fixtures/wikipedia-search-result.json