mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
chore: first commit
This commit is contained in:
parent
f8bb0b4c1a
commit
a83bff0feb
@ -13,7 +13,7 @@ import {
|
||||
SEARCH_PROVIDER,
|
||||
STEP_SLEEP,
|
||||
modelConfigs,
|
||||
DEFAULT_BUDGET_SPLIT_RATIO
|
||||
DEFAULT_BUDGET_SPLIT_RATIO, MAX_RECURSION_DEPTH
|
||||
} from "./config";
|
||||
import {TokenTracker} from "./utils/token-tracker";
|
||||
import {ActionTracker} from "./utils/action-tracker";
|
||||
@ -291,6 +291,7 @@ export async function getResponse(question: string, tokenBudget: number = 1_000_
|
||||
console.log(`| Recursion ${recursionLevel} | Step ${totalStep} | Token Budget ${tokenBudget} | Budget Used: ${budgetPercentage}% | Q: ${currentQuestion} |`);
|
||||
|
||||
// update all urls with buildURLMap
|
||||
allowReflect = allowReflect && (recursionLevel < MAX_RECURSION_DEPTH);
|
||||
allowRead = allowRead && (Object.keys(allURLs).length > 0);
|
||||
allowSearch = allowSearch && (Object.keys(allURLs).length < 20); // disable search when too many urls already
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ export const modelConfigs: ToolConfigs = {
|
||||
|
||||
export const STEP_SLEEP = 1000;
|
||||
export const DEFAULT_BUDGET_SPLIT_RATIO = 0.3; // Each sub-question gets 30% of parent's budget
|
||||
|
||||
export const MAX_RECURSION_DEPTH = 3;
|
||||
|
||||
if (!GEMINI_API_KEY) throw new Error("GEMINI_API_KEY not found");
|
||||
if (!JINA_API_KEY) throw new Error("JINA_API_KEY not found");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user