fix(websearch-rag): rag error (#10064)

This commit is contained in:
Chen Tao 2025-09-09 16:01:57 +08:00 committed by GitHub
parent de860ac316
commit 9b1aa3cd36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -115,7 +115,7 @@ class KnowledgeService {
const framework = knowledgeFrameworkFactory.getFramework(base)
await framework.initialize(base)
}
public async reset(_: Electron.IpcMainInvokeEvent, { base }: { base: KnowledgeBaseParams }): Promise<void> {
public async reset(_: Electron.IpcMainInvokeEvent, base: KnowledgeBaseParams): Promise<void> {
const framework = knowledgeFrameworkFactory.getFramework(base)
await framework.reset(base)
}

View File

@ -103,6 +103,8 @@ export class LangChainFramework implements IKnowledgeFramework {
if (fs.existsSync(dbPath)) {
fs.rmSync(dbPath, { recursive: true })
}
// 立即重建空索引,避免随后加载时报错
await this.createDatabase(base)
}
async delete(id: string): Promise<void> {

View File

@ -245,7 +245,7 @@ class WebSearchService {
created_at: Date.now(),
updated_at: Date.now(),
version: 1,
framework: 'embedjs'
framework: 'langchain'
}
// 更新LRU cache