Skip to content

Commit 0e91808

Browse files
yurekamizkexorabilityclaude
authored andcommitted
typing: Add type hints to TurnMetrics class in context.py (vllm-project#30552)
Co-authored-by: zkexorability <[email protected]> Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent af47de5 commit 0e91808

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

vllm/entrypoints/context.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,24 @@ class TurnMetrics:
7474

7575
def __init__(
7676
self,
77-
input_tokens=0,
78-
output_tokens=0,
79-
cached_input_tokens=0,
80-
tool_output_tokens=0,
81-
):
77+
input_tokens: int = 0,
78+
output_tokens: int = 0,
79+
cached_input_tokens: int = 0,
80+
tool_output_tokens: int = 0,
81+
) -> None:
8282
self.input_tokens = input_tokens
8383
self.output_tokens = output_tokens
8484
self.cached_input_tokens = cached_input_tokens
8585
self.tool_output_tokens = tool_output_tokens
8686

87-
def reset(self):
87+
def reset(self) -> None:
8888
"""Reset counters for a new turn."""
8989
self.input_tokens = 0
9090
self.output_tokens = 0
9191
self.cached_input_tokens = 0
9292
self.tool_output_tokens = 0
9393

94-
def copy(self):
94+
def copy(self) -> "TurnMetrics":
9595
"""Create a copy of this turn's token counts."""
9696
return TurnMetrics(
9797
self.input_tokens,

0 commit comments

Comments
 (0)