Make WordPress Core

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: raftaar1191's profile raftaar1191 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:
    • temperature
    • max_tokens
    • top_p
    • top_k
    • presence_penalty
    • frequency_penalty
  • The PSR-14 BeforeGenerateResultEvent is 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.

Change History (5)

#1 @JeffPaul
3 weeks ago

  • Keywords ai-client added

This ticket was mentioned in Slack in #core-ai by raftaar1191. View the logs.


3 weeks ago

#3 @westonruter
3 weeks ago

  • Focuses accessibility performance removed

This ticket was mentioned in Slack in #core-ai by westonruter. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.