You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #719 [AI Bundle] Preserve boolean options in agent/vectorizer model confguration (sonnymilton)
This PR was squashed before being merged into the main branch.
Discussion
----------
[AI Bundle] Preserve boolean options in agent/vectorizer model confguration
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
## Problem
When configuring models in `symfony/ai-bundle` via the `options` section, boolean values were **misrepresented**.
This happens because `http_build_query()` converts booleans into integers:
- `true` → `1`
- `false` → `0`
So configuration like:
```yaml
ai:
agent:
my_agent:
model:
name: gpt-4o-mini
options:
stream: false
```
Converted to `gpt-4o-mini?stream=0`
Expected: `gpt-4o-mini?stream=false`
This makes it impossible to distinguish between a booleans and an integers during parsing.
## Changes
- Inline normalization of options before calling `http_build_query()`. Booleans are explicitly converted to the strings `"true"` / `"false"`.
- Added regression tests for both agents and vectorizers.
Commits
-------
f107a20 [AI Bundle] Preserve boolean options in agent/vectorizer model confguration
0 commit comments