Skip to content

Commit cd07702

Browse files
committed
Merge branch 'main' of github.com:symfony/ai
2 parents e0ad357 + f9da9c0 commit cd07702

File tree

597 files changed

+14218
-2420
lines changed

Some content is hidden

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

597 files changed

+14218
-2420
lines changed

.github/build-packages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\Finder\Finder;
1010

1111
$finder = (new Finder())
12-
->in([__DIR__.'/../src/*/'])
12+
->in([__DIR__.'/../src/*/', __DIR__.'/../examples/', __DIR__.'/../demo/'])
1313
->depth(0)
1414
->name('composer.json')
1515
;

.github/workflows/code-quality.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Configure environment
3030
run: |
3131
echo COLUMNS=120 >> $GITHUB_ENV
32-
echo COMPOSER_UP='composer update --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
32+
echo COMPOSER_UP='composer update --no-progress --no-interaction --no-scripts --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
3333
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV
3434
3535
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
@@ -64,6 +64,10 @@ jobs:
6464
run: |
6565
cd examples/ && $COMPOSER_UP && ../link && $PHPSTAN
6666
67+
- name: Run PHPStan on demo
68+
run: |
69+
cd demo/ && $COMPOSER_UP && ../link && $PHPSTAN
70+
6771
- name: Run PHPStan on packages
6872
run: |
6973
source .github/workflows/.utils.sh

.github/workflows/integration-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
env:
18-
REQUIRED_PHP_EXTENSIONS: 'mongodb'
18+
REQUIRED_PHP_EXTENSIONS: 'mongodb, redis'
1919

2020
jobs:
2121
examples:

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Each component has its own test suite. Run tests for specific components:
3030
# Platform component
3131
cd src/platform && vendor/bin/phpunit
3232

33-
# Agent component
33+
# Agent component
3434
cd src/agent && vendor/bin/phpunit
3535

3636
# AI Bundle
@@ -111,10 +111,10 @@ Each component uses:
111111
- Do not use void return type for testcase methods
112112
- Always run PHP-CS-Fixer to ensure proper code style
113113
- Always add a newline at the end of the file
114-
- Prefer self::assert* oder $this->assert* in tests
114+
- Prefer self::assert* over $this->assert* in tests
115115
- Never add Claude as co-author in the commits
116116
- Add @author tags to newly introduced classes by the user
117117
- Prefer classic if statements over short-circuit evaluation when possible
118118
- Define array shapes for parameters and return types
119119
- Use project specific exceptions instead of global exception classes like \RuntimeException, \InvalidArgumentException etc.
120-
- NEVER mention Claude as co-author in commits
120+
- NEVER mention Claude as co-author in commits

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,3 @@ Help Symfony by [sponsoring](https://symfony.com/sponsor) its development!
3434
## Contributing
3535

3636
Thank you for considering contributing to Symfony AI! You can find the [contribution guide here](CONTRIBUTING.md).
37-
38-
## Fixture Licenses
39-
40-
For testing multi-modal features, the repository contains binary media content, with the following owners and licenses:
41-
42-
* `tests/Fixture/image.jpg`: Chris F., Creative Commons, see [pexels.com](https://www.pexels.com/photo/blauer-und-gruner-elefant-mit-licht-1680755/)
43-
* `tests/Fixture/audio.mp3`: davidbain, Creative Commons, see [freesound.org](https://freesound.org/people/davidbain/sounds/136777/)
44-
* `tests/Fixture/document.pdf`: Chem8240ja, Public Domain, see [Wikipedia](https://en.m.wikipedia.org/wiki/File:Re_example.pdf)

ai.symfony.com/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[{compose.yaml,compose.*.yaml}]
14+
indent_size = 2
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

ai.symfony.com/.env

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
13+
#
14+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16+
17+
###> symfony/framework-bundle ###
18+
APP_ENV=dev
19+
APP_SECRET=
20+
###< symfony/framework-bundle ###
21+
22+
###> symfony/routing ###
23+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
24+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
25+
DEFAULT_URI=http://localhost
26+
###< symfony/routing ###

ai.symfony.com/.env.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
###> symfony/framework-bundle ###
3+
APP_SECRET=4b506fc7c15aed9da5ea5bbd753f40fe
4+
###< symfony/framework-bundle ###

ai.symfony.com/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
###> symfony/framework-bundle ###
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
8+
/var/
9+
/vendor/
10+
###< symfony/framework-bundle ###
11+
12+
###> symfony/asset-mapper ###
13+
/public/assets/
14+
/assets/vendor/
15+
###< symfony/asset-mapper ###

ai.symfony.com/assets/app.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import './stimulus_bootstrap.js';
2+
import 'bootstrap';
3+
import 'bootstrap/dist/css/bootstrap.min.css';
4+
import './styles/app.css';
5+
6+
document.addEventListener('DOMContentLoaded', function() {
7+
new App();
8+
});
9+
10+
class App {
11+
constructor() {
12+
this.#initializeThemeSwitcher();
13+
}
14+
15+
#initializeThemeSwitcher() {
16+
const themeToggle = document.getElementById('themeToggle');
17+
const themeIcon = document.getElementById('themeIcon');
18+
const html = document.documentElement;
19+
20+
const icons = {
21+
auto: document.getElementById('icon-theme-auto').content,
22+
light: document.getElementById('icon-theme-light').content,
23+
dark: document.getElementById('icon-theme-dark').content,
24+
};
25+
26+
const getStoredTheme = () => localStorage.getItem('theme') || 'auto';
27+
const setStoredTheme = (theme) => localStorage.setItem('theme', theme);
28+
29+
const setTheme = (theme) => {
30+
const themeToApply = 'auto' === theme
31+
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
32+
: theme;
33+
html.setAttribute('data-bs-theme', themeToApply);
34+
};
35+
36+
const updateIcon = (theme) => {
37+
themeIcon.replaceChildren(icons[theme].firstElementChild.cloneNode(true));
38+
};
39+
40+
const cycleTheme = () => {
41+
const currentTheme = getStoredTheme();
42+
let nextTheme;
43+
44+
if ('auto' === currentTheme) {
45+
nextTheme = 'light';
46+
} else if ('light' === currentTheme) {
47+
nextTheme = 'dark';
48+
} else {
49+
nextTheme = 'auto';
50+
}
51+
52+
setStoredTheme(nextTheme);
53+
setTheme(nextTheme);
54+
updateIcon(nextTheme);
55+
};
56+
57+
const storedTheme = getStoredTheme();
58+
updateIcon(storedTheme);
59+
60+
themeToggle.addEventListener('click', cycleTheme);
61+
62+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
63+
if ('auto' === getStoredTheme()) {
64+
setTheme('auto');
65+
}
66+
});
67+
}
68+
}

0 commit comments

Comments
 (0)