Title: wp-includes/php-ai-client/src/AiClient.php | Developer.WordPress.org

---

# File: wp-includes/php-ai-client/src/AiClient.php

 * method[AiClient::message()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/message/)
 * Creates a new message builder for fluent API usage.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/message/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/message/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:351](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L351-L354)
 * method[AiClient::validateModelOrConfigParameter()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/validatemodelorconfigparameter/)
 * Validates that parameter is ModelInterface, ModelConfig, or null.
 * Used by [6 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/validatemodelorconfigparameter/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/validatemodelorconfigparameter/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:362](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L362-L367)
 * method[AiClient::getConfiguredPromptBuilder()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/getconfiguredpromptbuilder/)
 * Configures PromptBuilder based on model/config parameter type.
 * Used by [6 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/getconfiguredpromptbuilder/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/getconfiguredpromptbuilder/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:376](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L376-L386)
 * method[AiClient::prompt()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/prompt/)
 * Creates a new prompt builder for fluent API usage.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/prompt/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/prompt/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:210](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L210-L213)
 * method[AiClient::generateResult()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generateresult/)
 * Generates content using a unified API that automatically detects model capabilities.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generateresult/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generateresult/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:232](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L232-L236)
 * method[AiClient::generateTextResult()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatetextresult/)
 * Generates text using the traditional API approach.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatetextresult/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatetextresult/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:252](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L252-L256)
 * method[AiClient::generateImageResult()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generateimageresult/)
 * Generates an image using the traditional API approach.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generateimageresult/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generateimageresult/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:272](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L272-L276)
 * method[AiClient::convertTextToSpeechResult()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/converttexttospeechresult/)
 * Converts text to speech using the traditional API approach.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/converttexttospeechresult/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/converttexttospeechresult/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:292](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L292-L296)
 * method[AiClient::generateSpeechResult()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatespeechresult/)
 * Generates speech using the traditional API approach.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatespeechresult/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatespeechresult/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:312](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L312-L316)
 * method[AiClient::generateVideoResult()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatevideoresult/)
 * Generates a video using the traditional API approach.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatevideoresult/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/generatevideoresult/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:332](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L332-L336)
 * method[AiClient::isConfigured()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/isconfigured/)
 * Checks if a provider is configured and available for use.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/isconfigured/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/isconfigured/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:185](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L185-L196)
 * class[AiClient](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/)
 * Main AI Client class providing both fluent and traditional APIs for AI operations.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:82](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L82-L387)
 * method[AiClient::defaultRegistry()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/defaultregistry/)
 * Gets the default provider registry instance.
 * Used by [7 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/defaultregistry/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/defaultregistry/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:107](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L107-L113)
 * method[AiClient::setEventDispatcher()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/seteventdispatcher/)
 * Sets the event dispatcher for prompt lifecycle events.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/seteventdispatcher/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/seteventdispatcher/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:125](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L125-L128)
 * method[AiClient::getEventDispatcher()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/geteventdispatcher/)
 * Gets the event dispatcher for prompt lifecycle events.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/geteventdispatcher/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/geteventdispatcher/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:136](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L136-L139)
 * method[AiClient::setCache()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/setcache/)
 * Sets the PSR-16 cache for storing and retrieving cached data.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/setcache/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/setcache/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:151](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L151-L154)
 * method[AiClient::getCache()](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/getcache/)
 * Gets the PSR-16 cache instance.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/getcache/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wordpress-aiclient-aiclient/getcache/#uses)
   | Source: [wp-includes/php-ai-client/src/AiClient.php:162](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/php-ai-client/src/AiClient.php#L162-L165)