WordPress\AiClient\Providers\OpenAiCompatibleImplementation

AbstractOpenAiCompatibleImageGenerationModel::getResultId │ protected │ WP 0.4.0

Extracts the result ID from the API response data.

Метод класса: AbstractOpenAiCompatibleImageGenerationModel{}

Хуков нет.

Возвращает

string. The result ID.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->getResultId( $responseData ): string;
$responseData(array<string, mixed>) (обязательный)
The response data from the API.

Список изменений

С версии 0.4.0 Введена.

Код AbstractOpenAiCompatibleImageGenerationModel::getResultId() WP 7.1.4

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