<?php

namespace Laravel\Ai\Responses;

use Illuminate\Support\Collection;
use Laravel\Ai\Responses\Data\Meta;
use Laravel\Ai\Responses\Data\Usage;

class TranscriptionResponse
{
    public string $text;

    public Collection $segments;

    public Usage $usage;

    public Meta $meta;

    public function __construct(
        string $text,
        Collection $segments,
        Usage $usage,
        Meta $meta,
    ) {
        $this->text = $text;
        $this->segments = $segments ?? new Collection;
        $this->usage = $usage;
        $this->meta = $meta;
    }

    /**
     * Get the string representation of the transcription.
     */
    public function __toString(): string
    {
        return $this->text;
    }
}
