Creates a new AI prompt builder using the default provider registry.
Description
This is the main entry point for generating AI content in WordPress. It returns a fluent builder that can be used to configure and execute AI prompts. The prompt can be provided as a simple string for basic text prompts, or as more complex types for advanced use cases like multi-modal content or conversation history.
Initial prompt content. A string for simple text prompts, a MessagePart or Message object for structured content, an array for a message array shape, or a list of parts or messages for multi-turn conversations. Default null.Default: null
Signature, return type and hooks compared across 2 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/ai-client.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.