Commit 90741e9
committed
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 confgurationFile tree
2 files changed
+64
-0
lines changed- src/ai-bundle
- config
- tests/DependencyInjection
2 files changed
+64
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
| |||
698 | 704 | | |
699 | 705 | | |
700 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
701 | 713 | | |
702 | 714 | | |
703 | 715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2583 | 2583 | | |
2584 | 2584 | | |
2585 | 2585 | | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
2586 | 2638 | | |
2587 | 2639 | | |
2588 | 2640 | | |
| |||
0 commit comments