WordPress\AiClient\Results\DTO
GenerativeAiResult::toImageFile
Converts the first candidate to an image file.
Метод класса: GenerativeAiResult{}
Хуков нет.
Возвращает
File. The image file.
Использование
$GenerativeAiResult = new GenerativeAiResult(); $GenerativeAiResult->toImageFile(): File;
Список изменений
| С версии 0.1.0 | Введена. |
Код GenerativeAiResult::toImageFile() GenerativeAiResult::toImageFile WP 7.1.3
public function toImageFile(): File
{
$file = $this->toFile();
if (!$file->isImage()) {
throw new RuntimeException(sprintf('File is not an image. MIME type: %s', $file->getMimeType()));
}
return $file;
}