Skip to content

Commit 963b09f

Browse files
committed
[Platform] Split bridges into dedicated packages
Split all 25 platform bridges into dedicated, independently installable Composer packages following the same structure used for store bridges. Each bridge now has its own: - composer.json with proper dependencies - README.md, CHANGELOG.md, LICENSE - phpunit.xml.dist for isolated testing - .github/ templates Tests moved from tests/Bridge/{Name}/ to src/Bridge/{Name}/Tests/ with updated namespaces. Added platform bridge validation to CI workflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 3992a80 commit 963b09f

File tree

382 files changed

+4218
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+4218
-196
lines changed

.github/workflows/validation.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
paths:
66
- 'src/store/src/Bridge/**/composer.json'
77
- 'src/agent/src/Bridge/**/composer.json'
8+
- 'src/platform/src/Bridge/**/composer.json'
89
- 'src/ai-bundle/config/options.php'
910
- '.github/workflows/validation.yaml'
1011
pull_request:
1112
paths:
1213
- 'src/store/src/Bridge/**/composer.json'
1314
- 'src/agent/src/Bridge/**/composer.json'
15+
- 'src/platform/src/Bridge/**/composer.json'
1416
- 'src/ai-bundle/config/options.php'
1517
- '.github/workflows/validation.yaml'
1618

@@ -130,3 +132,52 @@ jobs:
130132
131133
echo ""
132134
echo "All tool bridge naming conventions are valid!"
135+
136+
validate_platforms:
137+
name: Validate Platform Bridge Naming
138+
runs-on: ubuntu-latest
139+
steps:
140+
- name: Checkout
141+
uses: actions/checkout@v5
142+
143+
- name: Validate platform bridge naming conventions
144+
run: |
145+
#!/bin/bash
146+
set -e
147+
148+
ERRORS=0
149+
150+
# Find all platform bridges with composer.json
151+
for composer_file in src/platform/src/Bridge/*/composer.json; do
152+
if [[ ! -f "$composer_file" ]]; then
153+
continue
154+
fi
155+
156+
# Get the bridge directory name (e.g., OpenAi)
157+
bridge_dir=$(dirname "$composer_file")
158+
bridge_name=$(basename "$bridge_dir")
159+
160+
# Get the package name from composer.json
161+
package_name=$(jq -r '.name' "$composer_file")
162+
163+
# Expected package name format: symfony/ai-{lowercase-with-dashes}-platform
164+
# Convert PascalCase to kebab-case (e.g., OpenAi -> open-ai)
165+
expected_kebab=$(echo "$bridge_name" | sed 's/\([a-z]\)\([A-Z]\)/\1-\2/g' | tr '[:upper:]' '[:lower:]')
166+
expected_package="symfony/ai-${expected_kebab}-platform"
167+
168+
if [[ "$package_name" != "$expected_package" ]]; then
169+
echo "::error file=$composer_file::Package name '$package_name' does not match expected '$expected_package' for bridge '$bridge_name'"
170+
ERRORS=$((ERRORS + 1))
171+
else
172+
echo "✓ $bridge_name: package name '$package_name' is correct"
173+
fi
174+
done
175+
176+
if [[ $ERRORS -gt 0 ]]; then
177+
echo ""
178+
echo "::error::Found $ERRORS naming convention violation(s)"
179+
exit 1
180+
fi
181+
182+
echo ""
183+
echo "All platform bridge naming conventions are valid!"

src/platform/composer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,29 @@
8787
"psr-4": {
8888
"Symfony\\AI\\Fixtures\\": "../../fixtures",
8989
"Symfony\\AI\\PHPStan\\": "../../.phpstan/",
90+
"Symfony\\AI\\Platform\\Bridge\\AiMlApi\\Tests\\": "src/Bridge/AiMlApi/Tests/",
91+
"Symfony\\AI\\Platform\\Bridge\\Albert\\Tests\\": "src/Bridge/Albert/Tests/",
92+
"Symfony\\AI\\Platform\\Bridge\\Anthropic\\Tests\\": "src/Bridge/Anthropic/Tests/",
93+
"Symfony\\AI\\Platform\\Bridge\\Azure\\Tests\\": "src/Bridge/Azure/Tests/",
94+
"Symfony\\AI\\Platform\\Bridge\\Bedrock\\Tests\\": "src/Bridge/Bedrock/Tests/",
95+
"Symfony\\AI\\Platform\\Bridge\\Cartesia\\Tests\\": "src/Bridge/Cartesia/Tests/",
96+
"Symfony\\AI\\Platform\\Bridge\\Cerebras\\Tests\\": "src/Bridge/Cerebras/Tests/",
97+
"Symfony\\AI\\Platform\\Bridge\\DeepSeek\\Tests\\": "src/Bridge/DeepSeek/Tests/",
98+
"Symfony\\AI\\Platform\\Bridge\\DockerModelRunner\\Tests\\": "src/Bridge/DockerModelRunner/Tests/",
99+
"Symfony\\AI\\Platform\\Bridge\\ElevenLabs\\Tests\\": "src/Bridge/ElevenLabs/Tests/",
100+
"Symfony\\AI\\Platform\\Bridge\\Gemini\\Tests\\": "src/Bridge/Gemini/Tests/",
101+
"Symfony\\AI\\Platform\\Bridge\\Generic\\Tests\\": "src/Bridge/Generic/Tests/",
102+
"Symfony\\AI\\Platform\\Bridge\\HuggingFace\\Tests\\": "src/Bridge/HuggingFace/Tests/",
103+
"Symfony\\AI\\Platform\\Bridge\\Meta\\Tests\\": "src/Bridge/Meta/Tests/",
104+
"Symfony\\AI\\Platform\\Bridge\\Mistral\\Tests\\": "src/Bridge/Mistral/Tests/",
105+
"Symfony\\AI\\Platform\\Bridge\\Ollama\\Tests\\": "src/Bridge/Ollama/Tests/",
106+
"Symfony\\AI\\Platform\\Bridge\\OpenAi\\Tests\\": "src/Bridge/OpenAi/Tests/",
107+
"Symfony\\AI\\Platform\\Bridge\\Perplexity\\Tests\\": "src/Bridge/Perplexity/Tests/",
108+
"Symfony\\AI\\Platform\\Bridge\\Replicate\\Tests\\": "src/Bridge/Replicate/Tests/",
109+
"Symfony\\AI\\Platform\\Bridge\\Scaleway\\Tests\\": "src/Bridge/Scaleway/Tests/",
110+
"Symfony\\AI\\Platform\\Bridge\\TransformersPhp\\Tests\\": "src/Bridge/TransformersPhp/Tests/",
111+
"Symfony\\AI\\Platform\\Bridge\\VertexAi\\Tests\\": "src/Bridge/VertexAi/Tests/",
112+
"Symfony\\AI\\Platform\\Bridge\\Voyage\\Tests\\": "src/Bridge/Voyage/Tests/",
90113
"Symfony\\AI\\Platform\\Tests\\": "tests/"
91114
}
92115
},
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.git* export-ignore
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please do not submit any Pull Requests here. They will be closed.
2+
---
3+
4+
Please submit your PR here instead:
5+
https://github.com/symfony/ai
6+
7+
This repository is what we call a "subtree split": a read-only subset of that main repository.
8+
We're looking forward to your PR there!
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Close Pull Request
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: superbrothers/close-pull-request@v3
12+
with:
13+
comment: |
14+
Thanks for your Pull Request! We love contributions.
15+
16+
However, you should instead open your PR on the main repository:
17+
https://github.com/symfony/ai
18+
19+
This repository is what we call a "subtree split": a read-only subset of that main repository.
20+
We're looking forward to your PR there!
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml
4+
.phpunit.result.cache
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG
2+
=========
3+
4+
0.1
5+
---
6+
7+
* Add the bridge
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2025-present Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
AiMlApi Platform
2+
================
3+
4+
AiML API platform bridge for Symfony AI.
5+
6+
Resources
7+
---------
8+
9+
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
10+
* [Report issues](https://github.com/symfony/ai/issues) and
11+
[send Pull Requests](https://github.com/symfony/ai/pulls)
12+
in the [main Symfony AI repository](https://github.com/symfony/ai)

src/platform/tests/Bridge/AiMlApi/ModelCatalogTest.php renamed to src/platform/src/Bridge/AiMlApi/Tests/ModelCatalogTest.php

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

12-
namespace Symfony\AI\Platform\Tests\Bridge\AiMlApi;
12+
namespace Symfony\AI\Platform\Bridge\AiMlApi\Tests;
1313

1414
use Symfony\AI\Platform\Bridge\AiMlApi\ModelCatalog;
1515
use Symfony\AI\Platform\Bridge\Generic\CompletionsModel;

0 commit comments

Comments
 (0)