<?php
namespace boru\boruai\Openai\Response\Parts\Content;

use boru\boruai\Openai\Models\BaseModel;

class OutputText extends BaseModel {
    private $type = "output_text";
    private $text;
    private $annotations = [];

    public function type($type=null) {
        if ($type) {
            $this->type = $type;
        }
        return $this->type;
    }
    public function text($text=null) {
        if ($text) {
            $this->text = $text;
        }
        return $this->text;
    }
    public function annotations($annotations=null) {
        if ($annotations) {
            $this->annotations = $annotations;
        }
        return $this->annotations;
    }

    public function toArray() {
        $array = [
            "type" => $this->type(),
            "text" => $this->text(),
        ];
        if($this->annotations()) {
            $array["annotations"] = $this->annotations();
        }
        return $array;
    }
}