Content index: what goes in, where it is kept, the model, and switching it on. * * The fields keep their existing controls (store-specific fields, multisite locks, the move * note, the live status and the estimate all have scripts and tests), placed in 2.0 cards and * rows by SettingsPage::legacyCards(). */ final class ContentIndexScreen { public static function render(): string { $on = Settings::enabled(); $body = Ui::stats([[ 'value' => Ui::num(UsageTracker::todayEmbedNeurons()), 'label' => __('neurons today (estimated from text length)', 'aipcf-ai-provider-for-cloudflare'), ]]); if (!$on) { $body = Ui::status(__('Off: nothing is sent. Choose what goes in and where it is kept, check the estimate, then switch it on at the end.', 'aipcf-ai-provider-for-cloudflare')); } $intro = Ui::card(__('Content index', 'aipcf-ai-provider-for-cloudflare'), $body, [ 'text' => __('Your posts, turned into an index of meanings, so the Site assistant, Related posts, Search, the Link assistant and Search insights can find posts by what they mean.', 'aipcf-ai-provider-for-cloudflare'), 'pill' => $on ? ['ok', __('On', 'aipcf-ai-provider-for-cloudflare')] : ['', __('Off', 'aipcf-ai-provider-for-cloudflare')], ]); return $intro . SettingsPage::legacyCards(EmbeddingsSettings::PAGE, [ 'aipcf_embed_status' => ['title' => __('Status', 'aipcf-ai-provider-for-cloudflare')], 'aipcf_embed_store' => [ 'title' => __('Where it is kept', 'aipcf-ai-provider-for-cloudflare'), 'text' => __('Vectorize uses your Cloudflare account. Qdrant and PostgreSQL are servers you run or rent.', 'aipcf-ai-provider-for-cloudflare'), 'labels' => [ 'embed_store' => __('Kept in', 'aipcf-ai-provider-for-cloudflare'), 'vectorize_index' => __('Index name', 'aipcf-ai-provider-for-cloudflare'), 'qdrant_url' => __('Qdrant address', 'aipcf-ai-provider-for-cloudflare'), 'qdrant_collection' => __('Collection', 'aipcf-ai-provider-for-cloudflare'), ], ], 'aipcf_embed_model' => [ 'title' => __('Model', 'aipcf-ai-provider-for-cloudflare'), 'text' => __('Turns your text into the index. Changing it builds the index again.', 'aipcf-ai-provider-for-cloudflare'), 'intro' => false, ], 'aipcf_embed_select' => [ 'title' => __('What goes in', 'aipcf-ai-provider-for-cloudflare'), 'text' => __('Only what you choose is sent to Workers AI. Password-protected posts never are, and any post can be left out from its editor.', 'aipcf-ai-provider-for-cloudflare'), 'intro' => false, ], 'aipcf_embed_estimate' => [ 'title' => __('Switch on', 'aipcf-ai-provider-for-cloudflare'), 'labels' => ['embeddings_enabled' => __('Content index', 'aipcf-ai-provider-for-cloudflare')], ], ]); } }