From fc24a75cb983f0fce1e3dcdf95d53afb9fb2d2b5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:02:19 +0000 Subject: [PATCH] fix: remove token categories from agent operations Co-Authored-By: sha.zhou@jina.ai --- src/agent.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent.ts b/src/agent.ts index 3f597f6..155112f 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -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}; }