<?php
namespace boru\boruai\Openai\Api\Endpoints;

use boru\boruai\Openai\OpenAI;
use boru\dhttp\core\Response;

class AudioAPI {
    public static function speech($parameters=[]) {
        $response = OpenAI::rawRequest("post","audio/speech",$parameters);
        if(is_object($response)) {
            throw new \Exception("Invalid response. Expected Response got ".get_class($response)."\n".print_r($response,true));    
        }
        return $response;
    }

    public static function retrieve($engine_id) {
        return OpenAI::request("get","engines/".$engine_id);
    }
}