directory = $directory; } public function setRequestAuthentication(RequestAuthenticationInterface $requestAuthentication): void { $this->requestAuthentication = $requestAuthentication; if ($this->directory instanceof WithRequestAuthenticationInterface) { $this->directory->setRequestAuthentication($requestAuthentication); } } public function setHttpTransporter(HttpTransporterInterface $httpTransporter): void { $this->httpTransporter = $httpTransporter; if ($this->directory instanceof WithHttpTransporterInterface) { $this->directory->setHttpTransporter($httpTransporter); } } public function isAvailable(): bool { return true; } public function getError(): ?\Throwable { return null; } public function isConfigured(): bool { try { $this->directory->listModelMetadata(); return true; } catch (Exception $e) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log("HuggingFace isConfigured failed: " . $e->getMessage()); return false; } } }