WP_AI_Client_Ability_Function_Resolver
- Since
- 7.0.0
- Source
wp-includes/ai-client/class-wp-ai-client-ability-function-resolver.php:25
Resolves and executes WordPress Abilities API function calls from AI models.
Description
This class must be instantiated with the specific abilities that the AI model is allowed to execute, ensuring that only explicitly specified abilities can be called. This prevents the model from executing arbitrary abilities.
Compatibility
- WordPress
- since 7.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 2 of the 5 tracked releases, added in 7.0.0.
Properties · 1
$allowed_abilitiesarray<string,private- Map of allowed ability names for this instance.
Methods · 7
- __construct()Constructor.
- is_ability_call()Checks if a function call is an ability call.
- execute_ability()Executes a WordPress ability from a function call.
- has_ability_calls()Checks if a message contains any ability function calls.
- execute_abilities()Executes all ability function calls in a message.
- ability_name_to_function_name()Converts an ability name to a function name.
- function_name_to_ability_name()Converts a function name to an ability name.
Changelog
Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/ai-client/class-wp-ai-client-ability-function-resolver.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.