mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 02:05:53 +01:00
feat(llm): remove everything to do with embeddings
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
* Validation functions for LLM Chat
|
||||
*/
|
||||
import options from "../../services/options.js";
|
||||
import { getEmbeddingStats } from "./communication.js";
|
||||
|
||||
/**
|
||||
* Validate embedding providers configuration
|
||||
* Validate providers configuration
|
||||
*/
|
||||
export async function validateEmbeddingProviders(validationWarning: HTMLElement): Promise<void> {
|
||||
export async function validateProviders(validationWarning: HTMLElement): Promise<void> {
|
||||
try {
|
||||
// Check if AI is enabled
|
||||
const aiEnabled = options.is('aiEnabled');
|
||||
@@ -62,23 +61,8 @@ export async function validateEmbeddingProviders(validationWarning: HTMLElement)
|
||||
// Add checks for other providers as needed
|
||||
}
|
||||
|
||||
// Fetch embedding stats to check if there are any notes being processed
|
||||
const embeddingStats = await getEmbeddingStats() as {
|
||||
success: boolean,
|
||||
stats: {
|
||||
totalNotesCount: number;
|
||||
embeddedNotesCount: number;
|
||||
queuedNotesCount: number;
|
||||
failedNotesCount: number;
|
||||
lastProcessedDate: string | null;
|
||||
percentComplete: number;
|
||||
}
|
||||
};
|
||||
const queuedNotes = embeddingStats?.stats?.queuedNotesCount || 0;
|
||||
const hasEmbeddingsInQueue = queuedNotes > 0;
|
||||
|
||||
// Show warning if there are configuration issues or embeddings in queue
|
||||
if (configIssues.length > 0 || hasEmbeddingsInQueue) {
|
||||
// Show warning if there are configuration issues
|
||||
if (configIssues.length > 0) {
|
||||
let message = '<i class="bx bx-error-circle me-2"></i><strong>AI Provider Configuration Issues</strong>';
|
||||
|
||||
message += '<ul class="mb-1 ps-4">';
|
||||
@@ -87,11 +71,6 @@ export async function validateEmbeddingProviders(validationWarning: HTMLElement)
|
||||
for (const issue of configIssues) {
|
||||
message += `<li>${issue}</li>`;
|
||||
}
|
||||
|
||||
// Show warning about embeddings queue if applicable
|
||||
if (hasEmbeddingsInQueue) {
|
||||
message += `<li>Currently processing embeddings for ${queuedNotes} notes. Some AI features may produce incomplete results until processing completes.</li>`;
|
||||
}
|
||||
|
||||
message += '</ul>';
|
||||
message += '<div class="mt-2"><a href="javascript:" class="settings-link btn btn-sm btn-outline-secondary"><i class="bx bx-cog me-1"></i>Open AI Settings</a></div>';
|
||||
@@ -103,7 +82,7 @@ export async function validateEmbeddingProviders(validationWarning: HTMLElement)
|
||||
validationWarning.style.display = 'none';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error validating embedding providers:', error);
|
||||
console.error('Error validating providers:', error);
|
||||
validationWarning.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user