WordPress\AiClient\Providers\OpenAiCompatibleImplementation

AbstractOpenAiCompatibleImageGenerationModel::throwIfNotSuccessfulprotectedWP 0.1.0

Throws an exception if the response is not successful.

Method of the class: AbstractOpenAiCompatibleImageGenerationModel{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->throwIfNotSuccessful( $response ): void;
$response(Response) (required)
The HTTP response to check.

Changelog

Since 0.1.0 Introduced.

AbstractOpenAiCompatibleImageGenerationModel::throwIfNotSuccessful() code WP 7.0

protected function throwIfNotSuccessful(Response $response): void
{
    /*
     * While this method only calls the utility method, it's important to have it here as a protected method so
     * that child classes can override it if needed.
     */
    ResponseUtil::throwIfNotSuccessful($response);
}