refactor: adjust minRelScore and maxBadAttempts

This commit is contained in:
Han Xiao 2025-06-10 13:11:09 -07:00
parent 727767e93b
commit 75275a7065
2 changed files with 7 additions and 4 deletions

View File

@ -393,7 +393,7 @@ export async function getResponse(question?: string,
badHostnames: string[] = [],
onlyHostnames: string[] = [],
maxRef: number = 10,
minRelScore: number = 0.85,
minRelScore: number = 0.80,
languageCode: string | undefined = undefined,
searchLanguageCode?: string,
searchProvider?: string,
@ -956,7 +956,10 @@ But unfortunately, you failed to solve the issue. You need to think out of the b
}
if (!(thisStep as AnswerAction).isFinal) {
logWarning('Enter Beast mode!!!');
logInfo(`Beast mode!!! budget ${(context.tokenTracker.getTotalUsage().totalTokens / tokenBudget * 100).toFixed(2)}%`, {
usage: context.tokenTracker.getTotalUsageSnakeCase(),
evaluationMetrics,
});
// any answer is better than no answer, humanity last resort
step++;
totalStep++;

View File

@ -225,10 +225,10 @@ function getTokenBudgetAndMaxAttempts(
case 'low':
return { tokenBudget: 100000, maxBadAttempts: 1 };
case 'high':
return { tokenBudget: 1000000, maxBadAttempts: 2 };
return { tokenBudget: 1000000, maxBadAttempts: 4 };
case 'medium':
default:
return { tokenBudget: 500000, maxBadAttempts: 1 };
return { tokenBudget: 500000, maxBadAttempts: 2 };
}
}