fix: remove token categories from agent operations

Co-Authored-By: sha.zhou@jina.ai <sha.zhou@jina.ai>
This commit is contained in:
Devin AI 2025-02-11 11:02:19 +00:00
parent 48315c9621
commit fc24a75cb9

View File

@ -12,7 +12,7 @@ import {evaluateAnswer, evaluateQuestion} from "./tools/evaluator";
import {analyzeSteps} from "./tools/error-analyzer";
import {TokenTracker} from "./utils/token-tracker";
import {ActionTracker} from "./utils/action-tracker";
import {StepAction, AnswerAction, TOKEN_CATEGORIES} from "./types";
import {StepAction, AnswerAction} from "./types";
import {TrackerContext} from "./types";
import {search} from "./tools/jina-search";
// import {grounding} from "./tools/grounding";
@ -366,7 +366,7 @@ export async function getResponse(question: string, tokenBudget: number = 1_000_
console.log(thisStep)
context.actionTracker.trackAction({totalStep, thisStep, gaps, badAttempts});
context.tokenTracker.trackUsage('agent', totalTokens, TOKEN_CATEGORIES.REASONING);
context.tokenTracker.trackUsage('agent', totalTokens);
// reset allowAnswer to true
allowAnswer = true;
@ -707,7 +707,7 @@ You decided to think out of the box or cut from a completely different angle.`);
await storeContext(prompt, schema, [allContext, allKeywords, allQuestions, allKnowledge], totalStep);
thisStep = object as StepAction;
context.actionTracker.trackAction({totalStep, thisStep, gaps, badAttempts});
context.tokenTracker.trackUsage('agent', totalTokens, TOKEN_CATEGORIES.REASONING);
context.tokenTracker.trackUsage('agent', totalTokens);
console.log(thisStep)
return {result: thisStep, context};
}