getMainConfig(); $context = RequestContext::getMain(); $endpoint = $config->get('IsekaiAIBackendEndpoint'); $authToken = $config->get('IsekaiAIToolboxToken'); $title = $this->title; $pageTitle = $title->getText(); $factory = MediaWikiServices::getInstance()->getHttpRequestFactory(); $req = $factory->create($endpoint . '/sys/embedding_search/title/update', [ 'method' => 'POST', 'postData' => [ 'title' => $pageTitle ], 'timeout' => 20 ], __METHOD__); $req->setHeader('Authorization', 'Bearer ' . $authToken); $status = Status::wrap($req->execute()); if (!$status->isOK()) { $formatterFactory = MediaWikiServices::getInstance()->getFormatterFactory(); $formatter = $formatterFactory->getStatusFormatter($context); $this->setLastError($formatter->getMessage($status)); return false; } return true; } }