update index ...

This commit is contained in:
duanfuxiang 2025-06-12 17:20:03 +08:00
parent ff2a559525
commit 990be82194
3 changed files with 7 additions and 9 deletions

View File

@ -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)

View File

@ -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: '',
},

View File

@ -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: