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
b2d385ad94
commit
0698382360
@ -286,11 +286,10 @@ export async function getResponse(question: string, tokenBudget: number = 1_000_
|
||||
step++;
|
||||
totalStep++;
|
||||
context.actionTracker.trackAction({totalStep, thisStep, gaps, badAttempts});
|
||||
const budgetPercentage = (context.tokenTracker.getTotalUsage() / tokenBudget * 100).toFixed(2);
|
||||
console.log(`| Recursion ${recursionLevel} | Step ${totalStep} | Budget used ${budgetPercentage}% |`);
|
||||
console.log('Gaps:', gaps);
|
||||
allowReflect = allowReflect && (gaps.length <= 1);
|
||||
const currentQuestion = gaps.length > 0 ? gaps.shift()! : question;
|
||||
const budgetPercentage = (context.tokenTracker.getTotalUsage() / tokenBudget * 100).toFixed(0);
|
||||
const currentQuestion = question
|
||||
console.log(`| Recursion ${recursionLevel} | Step ${totalStep} | Token Budget ${tokenBudget} | Budget Used: ${budgetPercentage}% | Q: ${currentQuestion} |`);
|
||||
|
||||
// update all urls with buildURLMap
|
||||
allowRead = allowRead && (Object.keys(allURLs).length > 0);
|
||||
allowSearch = allowSearch && (Object.keys(allURLs).length < 20); // disable search when too many urls already
|
||||
|
||||
@ -67,7 +67,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 DEFAULT_BUDGET_SPLIT_RATIO = 1; // Each sub-question gets 30% of parent's budget
|
||||
|
||||
|
||||
if (!GEMINI_API_KEY) throw new Error("GEMINI_API_KEY not found");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user