update index ...
This commit is contained in:
parent
ff2a559525
commit
990be82194
@ -131,12 +131,12 @@ export class VectorManager {
|
|||||||
|
|
||||||
const embeddingProgress = { completed: 0 }
|
const embeddingProgress = { completed: 0 }
|
||||||
const embeddingChunks: InsertVector[] = []
|
const embeddingChunks: InsertVector[] = []
|
||||||
const insertBatchSize = 100 // 数据库插入批量大小
|
const insertBatchSize = 64 // 数据库插入批量大小
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (embeddingModel.supportsBatch) {
|
if (embeddingModel.supportsBatch) {
|
||||||
// 支持批量处理的提供商:使用批量处理逻辑
|
// 支持批量处理的提供商:使用批量处理逻辑
|
||||||
const embeddingBatchSize = 100 // API批量处理大小
|
const embeddingBatchSize = 64 // API批量处理大小
|
||||||
|
|
||||||
for (let i = 0; i < contentChunks.length; i += embeddingBatchSize) {
|
for (let i = 0; i < contentChunks.length; i += embeddingBatchSize) {
|
||||||
const batchChunks = contentChunks.slice(i, Math.min(i + embeddingBatchSize, contentChunks.length))
|
const batchChunks = contentChunks.slice(i, Math.min(i + embeddingBatchSize, contentChunks.length))
|
||||||
@ -285,14 +285,15 @@ export class VectorManager {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const embeddingChunks: InsertVector[] = []
|
const embeddingChunks: InsertVector[] = []
|
||||||
const insertBatchSize = 100 // 数据库插入批量大小
|
const insertBatchSize = 64 // 数据库插入批量大小
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (embeddingModel.supportsBatch) {
|
if (embeddingModel.supportsBatch) {
|
||||||
// 支持批量处理的提供商:使用批量处理逻辑
|
// 支持批量处理的提供商:使用批量处理逻辑
|
||||||
const embeddingBatchSize = 100 // API批量处理大小
|
const embeddingBatchSize = 64 // API批量处理大小
|
||||||
|
|
||||||
for (let i = 0; i < contentChunks.length; i += embeddingBatchSize) {
|
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 batchChunks = contentChunks.slice(i, Math.min(i + embeddingBatchSize, contentChunks.length))
|
||||||
const batchTexts = batchChunks.map(chunk => chunk.content)
|
const batchTexts = batchChunks.map(chunk => chunk.content)
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ describe('parseSmartCopilotSettings', () => {
|
|||||||
anthropicApiKey: '',
|
anthropicApiKey: '',
|
||||||
filesSearchSettings: {
|
filesSearchSettings: {
|
||||||
method: 'auto',
|
method: 'auto',
|
||||||
regexBackend: 'ripgrep',
|
regexBackend: 'coreplugin',
|
||||||
matchBackend: 'coreplugin',
|
matchBackend: 'coreplugin',
|
||||||
ripgrepPath: '',
|
ripgrepPath: '',
|
||||||
},
|
},
|
||||||
@ -203,7 +203,7 @@ describe('settings migration', () => {
|
|||||||
anthropicApiKey: '',
|
anthropicApiKey: '',
|
||||||
filesSearchSettings: {
|
filesSearchSettings: {
|
||||||
method: 'auto',
|
method: 'auto',
|
||||||
regexBackend: 'ripgrep',
|
regexBackend: 'coreplugin',
|
||||||
matchBackend: 'coreplugin',
|
matchBackend: 'coreplugin',
|
||||||
ripgrepPath: '',
|
ripgrepPath: '',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1667,7 +1667,6 @@ export const GetProviderModels = async (provider: ApiProvider, settings?: InfioS
|
|||||||
switch (provider) {
|
switch (provider) {
|
||||||
case ApiProvider.Infio: {
|
case ApiProvider.Infio: {
|
||||||
const apiKey = settings?.infioProvider?.apiKey
|
const apiKey = settings?.infioProvider?.apiKey
|
||||||
console.log("apiKey", apiKey)
|
|
||||||
return await fetchInfioModels(apiKey)
|
return await fetchInfioModels(apiKey)
|
||||||
}
|
}
|
||||||
case ApiProvider.OpenRouter:
|
case ApiProvider.OpenRouter:
|
||||||
@ -1702,8 +1701,6 @@ export const GetProviderModelsWithSettings = async (provider: ApiProvider, setti
|
|||||||
switch (provider) {
|
switch (provider) {
|
||||||
case ApiProvider.Infio: {
|
case ApiProvider.Infio: {
|
||||||
const apiKey = settings?.infioProvider?.apiKey
|
const apiKey = settings?.infioProvider?.apiKey
|
||||||
console.log("apiKey", apiKey)
|
|
||||||
console.log("settings", settings)
|
|
||||||
return await fetchInfioModels(apiKey)
|
return await fetchInfioModels(apiKey)
|
||||||
}
|
}
|
||||||
case ApiProvider.OpenRouter:
|
case ApiProvider.OpenRouter:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user