Repository navigation
Only declare function support if a model declares tools support - #94
Merged
Merged
Conversation
âĶ bit. Check if a model declares support for tools and only then declare support for functions
Collaborator
Author
|
Note tests that run on PHP 7.4 and 8.0 are currently failing due to an upstream issue with those environments that has been fixed but not released yet: WordPress/gutenberg#82478 |
1 task done
saarnilauri
suggested changes
Sep 10, 2026
saarnilauri
left a comment
Contributor
There was a problem hiding this comment.
I have tested the fix in the setup I encountered the bug and the fix is verified. I left few comments while I reviewd the code changes.
saarnilauri
approved these changes
Sep 11, 2026
| ( option ) => | ||
| option.name === 'inputModalities' || | ||
| option.name === 'input_modalities' | ||
| ( option ) => option.name === 'inputModalities' |
Contributor
There was a problem hiding this comment.
Good catch. Even I noticed this in the PHP AI client PR, did not realize that input_modalities existed in the plugin as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
As reported in #93, we currently declare support for function calling on every text generation model. There are some models (like
gemma3) that support text generation but don't support calling functions (or tools). This can lead to the PHP AI Client assuming the model is supported for a specific request even though it won't actually work.This PR updates that to ensure we only declare function calling support if the model itself declares tool support. Also introduced some slight refactoring in a new
getModelCapabilitiesmethod. And we also ensure we showToolsas a supported option on our settings page.Closes #93
How to test the Change
Please see the detailed steps in #93
Changelog Entry
Credits
Props @saarnilauri, @dkotter
Checklist: