mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 20:00:00 +08:00
fix(Knowledge): pass searchResultCount to embed-js (#8118)
This commit is contained in:
parent
bea664af0f
commit
df43cb7a90
@ -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)
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user