Conversation
…and code judge proxy - Map AI SDK usage (inputTokens/outputTokens) to ProviderTokenUsage in mapResponse - Add optional tokenUsage field to EvaluatorResult and EvaluationScore types - Capture token usage from LLM judge generateText() and provider.invoke() calls - Accumulate token usage across target proxy invocations - Surface proxy tokenUsage in code evaluator results - Extend TargetInvokeResponse with per-call tokenUsage for code judge scripts - Pass tokenUsage through orchestrator EvaluationScore → EvaluatorResult mapping Closes #387 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying agentv with
|
| Latest commit: |
eafcedc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://27741650.agentv.pages.dev |
| Branch Preview URL: | https://feat-387-token-usage-trackin.agentv.pages.dev |
…sage, add unit tests
- Replace 6 inline `{ input: number; output: number }` types with shared TokenUsage import
- Add tokenUsage to ChildEvaluatorResult for accurate total cost tracking
- Add 7 unit tests covering type contracts and proxy accumulation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
inputTokens/outputTokens) toProviderTokenUsageinmapResponse— fixes Azure, Anthropic, and Gemini providerstokenUsagefield toEvaluatorResultandEvaluationScoretypesgenerateText()andprovider.invoke()callstokenUsagein code evaluator resultsTargetInvokeResponsewith per-calltokenUsagefor code judge scriptstokenUsagethrough orchestratorEvaluationScore→EvaluatorResultmappingTest plan
bun agentv eval examples/features/basic/evals/dataset.eval.yaml --test-id feature-proposal-brainstorm— verifytrace.token_usagein JSONLscores[].token_usageon LLM judge entries in JSONLtoken_usageon scores entryCloses #387
🤖 Generated with Claude Code