feat: support Gemini compare usage capture#19
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR enhances the retrieval ranking system with relation-aware expansion and evidence-based scoring, implements structured parsing of provider-reported token usage (Gemini and Claude) in the compare workflow, and extends retrieval benchmarks with new gold-standard questions and stricter evaluation metrics. Documentation is updated to reflect these changes and clarify token reporting semantics. Changes
Sequence Diagram(s)sequenceDiagram
actor Runner as Compare Runner
participant Parser as Compare Parser
participant Report as Report Writer
participant Summary as Summary Formatter
Runner->>Parser: emit stdout (JSON or text)
alt Structured JSON (Claude/Gemini)
Parser->>Parser: extract answer text & usage metadata
Note over Parser: Claude: usage field<br/>Gemini: usageMetadata
Parser->>Report: write answer text to artifact
Parser->>Report: record usage (input/total tokens,<br/>source label)
else Plain text or malformed JSON
Parser->>Parser: treat as plain answer text
Parser->>Report: write text to artifact
Parser->>Report: mark usage as null<br/>(fallback to cl100k_base)
end
Report->>Summary: sync prompt tokens & reduction ratios<br/>from captured usage
Summary->>Summary: format output with token deltas<br/>and source labels
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Test Plan
Summary by CodeRabbit
New Features
Documentation
Tests