<?php

declare(strict_types=1);

namespace KimaAI\Ai\Providers\DTO;

final class ImageRequest {
  public function __construct(
    public string $model,
    public string $prompt,
    public array $provider_options = []
  ) {
  }

  public static function fromArray(array $payload): self {
    return new self(
      (string) ($payload['model'] ?? ''),
      (string) ($payload['prompt'] ?? ''),
      $payload
    );
  }

  public function toArray(): array {
    $payload = $this->provider_options;
    $payload['model'] = $this->model;
    $payload['prompt'] = $this->prompt;
    return $payload;
  }
}
