WP_AI_Client_Discovery_Strategy{}WP 7.0.0└─ AbstractClientDiscoveryStrategy

Discovery strategy for WordPress HTTP client.

Registers the WordPress HTTP client adapter with the HTTPlug discovery system so the AI Client SDK can find and use it automatically.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Usage

$WP_AI_Client_Discovery_Strategy = new WP_AI_Client_Discovery_Strategy();
// use class methods

Methods

  1. protected static createClient( Psr17Factory $psr17_factory )

Changelog

Since 7.0.0 Introduced.

WP_AI_Client_Discovery_Strategy{} code WP 7.0

class WP_AI_Client_Discovery_Strategy extends AbstractClientDiscoveryStrategy {

	/**
	 * Creates an instance of the WordPress HTTP client.
	 *
	 * @since 7.0.0
	 *
	 * @param Psr17Factory $psr17_factory The PSR-17 factory for creating HTTP messages.
	 * @return ClientInterface The PSR-18 HTTP client.
	 */
	protected static function createClient( Psr17Factory $psr17_factory ): ClientInterface {
		return new WP_AI_Client_HTTP_Client( $psr17_factory, $psr17_factory );
	}
}