mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: categorize agent tokens as reasoning tokens
Co-Authored-By: sha.zhou@jina.ai <sha.zhou@jina.ai>
This commit is contained in:
parent
6fbbb5301e
commit
67347d7a40
@ -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} from "./types";
|
||||
import {StepAction, AnswerAction, TOKEN_CATEGORIES} 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);
|
||||
context.tokenTracker.trackUsage('agent', totalTokens, TOKEN_CATEGORIES.REASONING);
|
||||
|
||||
// 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);
|
||||
context.tokenTracker.trackUsage('agent', totalTokens, TOKEN_CATEGORIES.REASONING);
|
||||
console.log(thisStep)
|
||||
return {result: thisStep, context};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user