Commit 6209b20
committed
review: include tool-call argument tokens in tps generation window
- Bookmark first/last token timestamps on ResponseFunctionCallArgumentsDeltaEvent
too so the tps generation window covers all event types whose tokens land in
usage.output_tokens. Previously the numerator counted argument tokens but
the denominator excluded their generation time, inflating tps for tool-heavy
responses.
- Lifted the bookmarking out of the text-delta branch into a single up-front
check covering all four token-producing event types — cleaner than
duplicating across branches.
- Documented the single-token skip case (window collapses to 0) inline at the
guard. TPS is undefined for a one-token response so emitting nothing is
correct; the comment makes the intent visible to future readers.1 parent 45733c9 commit 6209b20
1 file changed
Lines changed: 17 additions & 9 deletions
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
728 | 742 | | |
729 | 743 | | |
730 | 744 | | |
| |||
790 | 804 | | |
791 | 805 | | |
792 | 806 | | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | 807 | | |
803 | 808 | | |
804 | 809 | | |
| |||
1075 | 1080 | | |
1076 | 1081 | | |
1077 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1078 | 1086 | | |
1079 | 1087 | | |
1080 | 1088 | | |
| |||
0 commit comments