mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
feat: add url ranking
This commit is contained in:
@@ -137,8 +137,7 @@ ${learnedStrategy}
|
||||
urlList = (weightedURLs)
|
||||
.filter(r => 'url' in r)
|
||||
.sort((a, b) => (b.boostedWeight || 0) - (a.boostedWeight || 0))
|
||||
.slice(0, 10) // save context window and reduce noise, only keep top 10 urls
|
||||
.map(r => ` + weight: ${r.boostedWeight.toFixed(3)} "${r.url}": "${r.title}"`)
|
||||
.map(r => ` + weight: ${r.boostedWeight.toFixed(2)} "${r.url}": "${r.title}"`)
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
@@ -147,7 +146,7 @@ ${learnedStrategy}
|
||||
- Access and read full content from URLs
|
||||
- Must check URLs mentioned in <question> if any
|
||||
${urlList ? `
|
||||
- Choose and visit relevant URLs below for more knowledge. higher weight means more relevant and you should visit first:
|
||||
- Choose and visit relevant URLs below for more knowledge. higher weight suggests more relevant:
|
||||
<url-list>
|
||||
${urlList}
|
||||
</url-list>
|
||||
|
||||
@@ -3,7 +3,7 @@ import {TokenTracker} from "../utils/token-tracker";
|
||||
import {JINA_API_KEY} from "../config";
|
||||
|
||||
const JINA_API_URL = 'https://api.jina.ai/v1/embeddings';
|
||||
const SIMILARITY_THRESHOLD = 0.888; // Adjustable threshold for cosine similarity
|
||||
const SIMILARITY_THRESHOLD = 0.86; // Adjustable threshold for cosine similarity
|
||||
|
||||
const JINA_API_CONFIG = {
|
||||
MODEL: 'jina-embeddings-v3',
|
||||
|
||||
Reference in New Issue
Block a user