Skip to content

Conversation

sonnymilton
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Docs? no
Issues -
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:

  • true1
  • false0

So configuration like:

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.

@carsonbot carsonbot added AI Bundle Issues & PRs about the AI integration bundle Feature New feature Status: Needs Review labels Oct 2, 2025
@OskarStark OskarStark force-pushed the ai-bundle-config-model-bool-options branch from 6af6462 to f107a20 Compare October 2, 2025 13:54
@OskarStark
Copy link
Contributor

Good catch, thanks @sonnymilton.

@OskarStark OskarStark merged commit 90741e9 into symfony:main Oct 2, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Bundle Issues & PRs about the AI integration bundle Feature New feature Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants