feat(ai-chat): show RAG indexing coverage in AI settings
Display "Indexed N of M pages" on the AI provider settings page so admins
can see how much of the wiki is covered by vector-RAG semantic search.
- page-embedding.repo: add countIndexedPages() — distinct non-deleted pages
that have stored embeddings in the workspace
- page.repo: add countByWorkspace() — total non-deleted pages
- ai-settings.service: compute both counts in getMasked() (Promise.all) and
return them with the masked settings; inject PageEmbeddingRepo + PageRepo
- MaskedAiSettings / IAiSettings: add indexedPages + totalPages
- ai-provider-settings: render a dimmed coverage line under "Embedding model"
- i18n: add the "Indexed {{indexed}} of {{total}} pages" key (en-US, ru-RU)
This commit is contained in:
@@ -188,6 +188,15 @@ export default function AiProviderSettings() {
|
||||
{...form.getInputProps("embeddingModel")}
|
||||
/>
|
||||
|
||||
{settings && (
|
||||
<Text size="sm" c="dimmed" mt={-8}>
|
||||
{t("Indexed {{indexed}} of {{total}} pages", {
|
||||
indexed: settings.indexedPages ?? 0,
|
||||
total: settings.totalPages ?? 0,
|
||||
})}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
<Textarea
|
||||
label={t("System message")}
|
||||
description={t(
|
||||
|
||||
@@ -12,6 +12,9 @@ export interface IAiSettings {
|
||||
baseUrl?: string;
|
||||
systemPrompt?: string;
|
||||
hasApiKey: boolean;
|
||||
// RAG indexing coverage (pages indexed for semantic search).
|
||||
indexedPages: number;
|
||||
totalPages: number;
|
||||
}
|
||||
|
||||
// Update payload. Key semantics:
|
||||
|
||||
Reference in New Issue
Block a user