class WP_AI_Client_Discovery_Strategy {}

In this article

This class’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Discovery strategy for WordPress HTTP client.

Description

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

Methods

NameDescription
WP_AI_Client_Discovery_Strategy::createClientCreates an instance of the WordPress HTTP client.

Source

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 );
	}
}

Changelog

VersionDescription
7.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.