Skip to content

Conversation

franzwilding
Copy link
Contributor

Q A
Bug fix? yes
New feature? yes
Docs? no
License MIT

The mistral platform factory gets a contract per default as an argument, so all the internal normalizers will not be used. This PR changes this by adding a custom MistralContract that will be used (like in the openAI birdge).

This PR also adds an imageUrl normalizer, since the mistral chat api supports image_urls as well.

@carsonbot carsonbot added Bug Something isn't working Feature New feature Platform Issues & PRs about the AI Platform component Status: Needs Review labels Oct 16, 2025
Comment on lines 40 to 38
$contract ?? Contract::create(
new ToolNormalizer(),
new DocumentNormalizer(),
new DocumentUrlNormalizer(),
),
$contract ?? MistralContract::create(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this described bug the same problem for all other bridges as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OskarStark I’m not entirely sure, but I believe that’s the case. I haven’t fully figured out how it’s supposed to work yet. What I noticed is that for all bridges without their own contract, the default contract is passed as an argument to the platform factories. Since it’s already set, Contract::create() is never called. One possible solution might be to avoid passing a default contract at all—what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean via the bundle config, yes lets not inject the default one there, can you open a separate PR please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franzwilding
Copy link
Contributor Author

@OskarStark I removed the dedicated mistral contract. Once #789 is merged, this PR can also be merged and the new imageUrlNormalizer gets added directly in the platform factory.

@OskarStark OskarStark changed the title [Platform] Add imageurl normalizer to mistral + create custom contract [Platform][Mistral] Add ImageUrlNormalizer Oct 16, 2025
@OskarStark
Copy link
Contributor

Thank you @franzwilding.

@OskarStark OskarStark merged commit 27f4121 into symfony:main Oct 16, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Feature New feature Platform Issues & PRs about the AI Platform component Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants