anthropics / anthropics/claude-agent-sdk-python

Python SDK ResultMessage's message.usage['input_tokens'] isn't correct

Đang mở
#112 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
8.1k
Fork
1.3k
Merge trung bình
2 ngày 31 phút
Pull request đã merge (30 ngày)
1

Mô tả

I am trying to analyze token in and out for Claude Code Python SDK.
For my task, after completion, I looked at the ResultMessage,
usage['input_tokens'] is 69
usage['output_tokens'] is 18467

The input_tokens here is really off
and output_tokens seem to be accumulated correctly.

I looked at cache_creation_input_tokens and cache_read_input_tokens stored in usage dictionary.
They don't seem to represent cumulative input_tokens.

I used this prompt for my coding task

https://github.com/RooCodeInc/Roo-Code-Evals/blob/main/prompts/python.md

and had cwd pointed to this

https://github.com/RooCodeInc/Roo-Code-Evals/tree/main/python/pov

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.