merge web_search and fetch_urls_contents

This commit is contained in:
duanfuxiang
2025-03-20 08:56:18 +08:00
parent 679d7142eb
commit 76ecca0da9
3 changed files with 124 additions and 35 deletions

View File

@@ -97,7 +97,7 @@ export class RAGEngine {
if (!this.initialized) {
await this.updateVaultIndex({ reindexAll: false }, onQueryProgressChange)
}
const queryEmbedding = await this.getQueryEmbedding(query)
const queryEmbedding = await this.getEmbedding(query)
onQueryProgressChange?.({
type: 'querying',
})
@@ -123,7 +123,7 @@ export class RAGEngine {
return queryResult
}
private async getQueryEmbedding(query: string): Promise<number[]> {
async getEmbedding(query: string): Promise<number[]> {
if (!this.embeddingModel) {
throw new Error('Embedding model is not set')
}