chore: first commit

This commit is contained in:
Han Xiao 2025-02-04 22:13:27 +08:00
parent b2d385ad94
commit 0698382360
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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");