baseUrl,'/').$path); $headers=['Accept: application/json','Content-Type: application/json']; if($this->token) $headers[]='Authorization: Bearer '.$this->token; curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_CUSTOMREQUEST=>$method,CURLOPT_HTTPHEADER=>$headers]); if($payload!==null) curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($payload,JSON_THROW_ON_ERROR)); $body=curl_exec($ch); if($body===false) throw new RuntimeException(curl_error($ch)); $status=curl_getinfo($ch,CURLINFO_HTTP_CODE); curl_close($ch); $data=json_decode($body,true,512,JSON_THROW_ON_ERROR); if($status>=400) throw new RuntimeException($data['message']??('HTTP '.$status)); return $data; } public function publicModels(): array { return $this->request('GET','/api/public/v1/lqm/models'); } public function execute(string $model,array $input,array $parameters=[]): array { return $this->request('POST','/api/v1/lqm/execute',['model'=>$model,'input'=>$input,'parameters'=>$parameters]); } public function evidence(string $uuid): array { return $this->request('GET','/api/v1/lqm/evidence/'.$uuid); } }