SetHeader(); } public function generate( $promt, $context = '' ){ $url = $this->host.self::$urlgen; $cmd = array( "model" => $this->model, "prompt" => $promt, "stream" => false, 'keep_alive' =>'60m' ); if( $context ){ $cmd['context'] = $context; } $r = $this->Send( $url, $cmd ); $this->res = $r; return $r; } public function GetTime(){ $r = $this->res; $robj = json_decode($r); return $robj->eval_duration/1000000000; } public function Getres(){ $r = $this->res; $robj = json_decode($r); return nl2br($robj->response); } public function Getcontext(){ $r = $this->res; $robj = json_decode($r); return $robj->context; } }