From 990be8219440b3409f366791e3cc02f1e8835ff9 Mon Sep 17 00:00:00 2001 From: duanfuxiang Date: Thu, 12 Jun 2025 17:20:03 +0800 Subject: [PATCH] update index ... --- src/database/modules/vector/vector-manager.ts | 9 +++++---- src/types/settings.test.ts | 4 ++-- src/utils/api.ts | 3 --- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/database/modules/vector/vector-manager.ts b/src/database/modules/vector/vector-manager.ts index 962ba50..a579f67 100644 --- a/src/database/modules/vector/vector-manager.ts +++ b/src/database/modules/vector/vector-manager.ts @@ -131,12 +131,12 @@ export class VectorManager { const embeddingProgress = { completed: 0 } const embeddingChunks: InsertVector[] = [] - const insertBatchSize = 100 // 数据库插入批量大小 + const insertBatchSize = 64 // 数据库插入批量大小 try { if (embeddingModel.supportsBatch) { // 支持批量处理的提供商:使用批量处理逻辑 - const embeddingBatchSize = 100 // API批量处理大小 + const embeddingBatchSize = 64 // API批量处理大小 for (let i = 0; i < contentChunks.length; i += embeddingBatchSize) { const batchChunks = contentChunks.slice(i, Math.min(i + embeddingBatchSize, contentChunks.length)) @@ -285,14 +285,15 @@ export class VectorManager { }) const embeddingChunks: InsertVector[] = [] - const insertBatchSize = 100 // 数据库插入批量大小 + const insertBatchSize = 64 // 数据库插入批量大小 try { if (embeddingModel.supportsBatch) { // 支持批量处理的提供商:使用批量处理逻辑 - const embeddingBatchSize = 100 // API批量处理大小 + const embeddingBatchSize = 64 // API批量处理大小 for (let i = 0; i < contentChunks.length; i += embeddingBatchSize) { + console.log(`Embedding batch ${i / embeddingBatchSize + 1} of ${Math.ceil(contentChunks.length / embeddingBatchSize)}`) const batchChunks = contentChunks.slice(i, Math.min(i + embeddingBatchSize, contentChunks.length)) const batchTexts = batchChunks.map(chunk => chunk.content) diff --git a/src/types/settings.test.ts b/src/types/settings.test.ts index 646d61b..3870557 100644 --- a/src/types/settings.test.ts +++ b/src/types/settings.test.ts @@ -15,7 +15,7 @@ describe('parseSmartCopilotSettings', () => { anthropicApiKey: '', filesSearchSettings: { method: 'auto', - regexBackend: 'ripgrep', + regexBackend: 'coreplugin', matchBackend: 'coreplugin', ripgrepPath: '', }, @@ -203,7 +203,7 @@ describe('settings migration', () => { anthropicApiKey: '', filesSearchSettings: { method: 'auto', - regexBackend: 'ripgrep', + regexBackend: 'coreplugin', matchBackend: 'coreplugin', ripgrepPath: '', }, diff --git a/src/utils/api.ts b/src/utils/api.ts index b032c9f..8e9e111 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -1667,7 +1667,6 @@ export const GetProviderModels = async (provider: ApiProvider, settings?: InfioS switch (provider) { case ApiProvider.Infio: { const apiKey = settings?.infioProvider?.apiKey - console.log("apiKey", apiKey) return await fetchInfioModels(apiKey) } case ApiProvider.OpenRouter: @@ -1702,8 +1701,6 @@ export const GetProviderModelsWithSettings = async (provider: ApiProvider, setti switch (provider) { case ApiProvider.Infio: { const apiKey = settings?.infioProvider?.apiKey - console.log("apiKey", apiKey) - console.log("settings", settings) return await fetchInfioModels(apiKey) } case ApiProvider.OpenRouter: