WordPress\AiClient\Providers\OpenAiCompatibleImplementation

AbstractOpenAiCompatibleImageGenerationModel::getResultId │ protected │ WP 0.4.0

Extracts the result ID from the API response data.

Method of the class: AbstractOpenAiCompatibleImageGenerationModel{}

No Hooks.

Returns

string. The result ID.

Usage

// protected - for code of main (parent) or child class
$result = $this->getResultId( $responseData ): string;
$responseData(array<string, mixed>) (required)
The response data from the API.

Changelog

Since 0.4.0 Introduced.

AbstractOpenAiCompatibleImageGenerationModel::getResultId() code WP 7.1.2

protected function getResultId(array $responseData): string
{
    return isset($responseData['id']) && is_string($responseData['id']) ? $responseData['id'] : '';
}