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

View File

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