Opened 3 weeks ago
Last modified 3 weeks ago
#65115 new feature request
AI Client lacks filters for customizing model selection and generation parameters
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | AI | Keywords: | ai-client needs-patch 2nd-opinion |
| Focuses: | Cc: |
Description
The AI Client in WordPress 7.0 provides very limited filtering capabilities for third-party plugin customization.
Existing Filters
Currently, only two filters exist:
wp_ai_client_default_request_timeout(HTTP timeout only)wp_ai_client_prevent_prompt(request abort only)
Current Limitations
There is currently no way for third-party plugins to customize:
- Model selection per-capability (text generation, image generation, vision)
- Generation parameters:
temperaturemax_tokenstop_ptop_kpresence_penaltyfrequency_penalty
- The PSR-14
BeforeGenerateResultEventis read-only and cannot modify parameters
Impact
This severely limits the ability of plugin developers to build AI-powered features with custom behavior and control. Plugin developers cannot:
- Dynamically select different models based on context or user role
- Adjust temperature for deterministic vs. creative output
- Control token limits per-capability or per-context
- Set request timeouts per-capability
- Conditionally modify generation parameters based on post type, user subscription, or other factors
Why This Matters
Without these hooks, developers are forced to use workarounds and cannot leverage standard WordPress filter conventions for AI Client customization. This limits the extensibility of the AI Client and prevents a rich ecosystem of AI-powered plugins from being built.
related: https://core.trac.wordpress.org/ticket/65097