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
The WP_Ability class uses array $input in several places.
While this is likely working for 90% of use-cases, the shape of the input depends on the input schema that is used. That input schema can signify any type that can be expressed in JSON schema - but the PHP array type hint only works for the JSON schema types object and array.
While based on my experience using a parameter scheme of object is extremely common, any other types are possible and supported by function calling capabilities of most popular LLMs.
As such, I think the array type hint on $input is a bug and should be fixed. It needs to be without a type hint, as it can be mixed.
The
WP_Abilityclass usesarray $inputin several places.While this is likely working for 90% of use-cases, the shape of the input depends on the input schema that is used. That input schema can signify any type that can be expressed in JSON schema - but the PHP
arraytype hint only works for the JSON schema typesobjectandarray.While based on my experience using a parameter scheme of
objectis extremely common, any other types are possible and supported by function calling capabilities of most popular LLMs.As such, I think the
arraytype hint on$inputis a bug and should be fixed. It needs to be without a type hint, as it can bemixed.