fix(Knowledge): pass searchResultCount to embed-js (#8118)

This commit is contained in:
one 2025-07-13 20:22:02 +08:00 committed by GitHub
parent bea664af0f
commit df43cb7a90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -125,7 +125,8 @@ class KnowledgeService {
apiKey,
apiVersion,
baseURL,
dimensions
dimensions,
documentCount
}: KnowledgeBaseParams): Promise<RAGApplication> => {
let ragApplication: RAGApplication
const embeddings = new Embeddings({
@ -141,6 +142,7 @@ class KnowledgeService {
.setModel('NO_MODEL')
.setEmbeddingModel(embeddings)
.setVectorDatabase(new LibSqlDb({ path: path.join(this.storageDir, id) }))
.setSearchResultCount(documentCount || 30)
.build()
} catch (e) {
Logger.error(e)

View File

@ -51,9 +51,8 @@ export const getKnowledgeBaseParams = (base: KnowledgeBase): KnowledgeBaseParams
rerankModelProvider: rerankProvider.name.toLowerCase(),
// topN: base.topN,
// preprocessing: base.preprocessing,
preprocessOrOcrProvider: base.preprocessOrOcrProvider
// topN: base.topN
preprocessOrOcrProvider: base.preprocessOrOcrProvider,
documentCount: base.documentCount
}
}