Skip to content

Commit 28c461b

Browse files
author
Workshop Participant
committed
Adds cache tokens to usage type
1 parent 91bf184 commit 28c461b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/strands/types/event_loop.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55
from typing_extensions import TypedDict
66

77

8-
class Usage(TypedDict):
8+
class Usage(TypedDict, total=False):
99
"""Token usage information for model interactions.
1010
1111
Attributes:
1212
inputTokens: Number of tokens sent in the request to the model..
1313
outputTokens: Number of tokens that the model generated for the request.
1414
totalTokens: Total number of tokens (input + output).
15+
cacheReadInputTokens: Number of tokens read from cache.
16+
cacheWriteInputTokens: Number of tokens written to cache.
1517
"""
1618

1719
inputTokens: int
1820
outputTokens: int
1921
totalTokens: int
22+
cacheReadInputTokens: int
23+
cacheWriteInputTokens: int
2024

2125

2226
class Metrics(TypedDict):

0 commit comments

Comments
 (0)