<?php

declare(strict_types=1);

namespace KimaAI\Ai\Providers\Http;

final class HttpResponse {
  public function __construct(
    public int $status,
    public string $body,
    public array $headers = []
  ) {
  }

  public function json(): array {
    $decoded = json_decode($this->body, true);
    return is_array($decoded) ? $decoded : [];
  }
}
