@@ -92,6 +92,7 @@ def sync_event_loop():
9292 input_tokens = 20 ,
9393 input_tokens_details = InputTokensDetails (
9494 cached_tokens = 5 ,
95+ cache_write_tokens = 0 ,
9596 ),
9697 output_tokens = 10 ,
9798 output_tokens_details = OutputTokensDetails (
@@ -109,7 +110,10 @@ def mock_usage():
109110 input_tokens = 10 ,
110111 output_tokens = 20 ,
111112 total_tokens = 30 ,
112- input_tokens_details = InputTokensDetails (cached_tokens = 0 ),
113+ input_tokens_details = InputTokensDetails (
114+ cached_tokens = 0 ,
115+ cache_write_tokens = 0 ,
116+ ),
113117 output_tokens_details = OutputTokensDetails (reasoning_tokens = 5 ),
114118 )
115119
@@ -1536,6 +1540,7 @@ async def test_handoff_span(
15361540 input_tokens = 10 ,
15371541 input_tokens_details = InputTokensDetails (
15381542 cached_tokens = 0 ,
1543+ cache_write_tokens = 0 ,
15391544 ),
15401545 output_tokens = 20 ,
15411546 output_tokens_details = OutputTokensDetails (
@@ -1575,6 +1580,7 @@ async def test_handoff_span(
15751580 input_tokens = 10 ,
15761581 input_tokens_details = InputTokensDetails (
15771582 cached_tokens = 0 ,
1583+ cache_write_tokens = 0 ,
15781584 ),
15791585 output_tokens = 20 ,
15801586 output_tokens_details = OutputTokensDetails (
@@ -1713,6 +1719,7 @@ async def test_max_turns_before_handoff_span(
17131719 input_tokens = 10 ,
17141720 input_tokens_details = InputTokensDetails (
17151721 cached_tokens = 0 ,
1722+ cache_write_tokens = 0 ,
17161723 ),
17171724 output_tokens = 20 ,
17181725 output_tokens_details = OutputTokensDetails (
@@ -1752,6 +1759,7 @@ async def test_max_turns_before_handoff_span(
17521759 input_tokens = 10 ,
17531760 input_tokens_details = InputTokensDetails (
17541761 cached_tokens = 0 ,
1762+ cache_write_tokens = 0 ,
17551763 ),
17561764 output_tokens = 20 ,
17571765 output_tokens_details = OutputTokensDetails (
@@ -1876,6 +1884,7 @@ def simple_test_tool(message: str) -> str:
18761884 input_tokens = 10 ,
18771885 input_tokens_details = InputTokensDetails (
18781886 cached_tokens = 0 ,
1887+ cache_write_tokens = 0 ,
18791888 ),
18801889 output_tokens = 5 ,
18811890 output_tokens_details = OutputTokensDetails (
@@ -1887,6 +1896,7 @@ def simple_test_tool(message: str) -> str:
18871896 input_tokens = 15 ,
18881897 input_tokens_details = InputTokensDetails (
18891898 cached_tokens = 0 ,
1899+ cache_write_tokens = 0 ,
18901900 ),
18911901 output_tokens = 10 ,
18921902 output_tokens_details = OutputTokensDetails (
@@ -2664,6 +2674,7 @@ async def test_hosted_mcp_tool_propagation_header_streamed(
26642674 input_tokens = 20 ,
26652675 input_tokens_details = InputTokensDetails (
26662676 cached_tokens = 5 ,
2677+ cache_write_tokens = 0 ,
26672678 ),
26682679 output_tokens = 10 ,
26692680 output_tokens_details = OutputTokensDetails (
@@ -3607,6 +3618,7 @@ def failing_tool(message: str) -> str:
36073618 input_tokens = 10 ,
36083619 input_tokens_details = InputTokensDetails (
36093620 cached_tokens = 0 ,
3621+ cache_write_tokens = 0 ,
36103622 ),
36113623 output_tokens = 5 ,
36123624 output_tokens_details = OutputTokensDetails (
@@ -3618,6 +3630,7 @@ def failing_tool(message: str) -> str:
36183630 input_tokens = 15 ,
36193631 input_tokens_details = InputTokensDetails (
36203632 cached_tokens = 0 ,
3633+ cache_write_tokens = 0 ,
36213634 ),
36223635 output_tokens = 10 ,
36233636 output_tokens_details = OutputTokensDetails (
@@ -3778,6 +3791,7 @@ async def test_invoke_agent_span_includes_usage_data(
37783791 input_tokens = 10 ,
37793792 input_tokens_details = InputTokensDetails (
37803793 cached_tokens = 0 ,
3794+ cache_write_tokens = 0 ,
37813795 ),
37823796 output_tokens = 20 ,
37833797 output_tokens_details = OutputTokensDetails (
@@ -3921,6 +3935,7 @@ async def test_ai_client_span_includes_response_model(
39213935 input_tokens = 10 ,
39223936 input_tokens_details = InputTokensDetails (
39233937 cached_tokens = 0 ,
3938+ cache_write_tokens = 0 ,
39243939 ),
39253940 output_tokens = 20 ,
39263941 output_tokens_details = OutputTokensDetails (
@@ -4052,6 +4067,7 @@ async def test_ai_client_span_response_model_with_chat_completions(
40524067 input_tokens = 15 ,
40534068 input_tokens_details = InputTokensDetails (
40544069 cached_tokens = 0 ,
4070+ cache_write_tokens = 0 ,
40554071 ),
40564072 output_tokens = 25 ,
40574073 output_tokens_details = OutputTokensDetails (
@@ -4177,6 +4193,7 @@ def calculator(a: int, b: int) -> int:
41774193 input_tokens = 10 ,
41784194 input_tokens_details = InputTokensDetails (
41794195 cached_tokens = 0 ,
4196+ cache_write_tokens = 0 ,
41804197 ),
41814198 output_tokens = 5 ,
41824199 output_tokens_details = OutputTokensDetails (
@@ -4216,6 +4233,7 @@ def calculator(a: int, b: int) -> int:
42164233 input_tokens = 20 ,
42174234 input_tokens_details = InputTokensDetails (
42184235 cached_tokens = 5 ,
4236+ cache_write_tokens = 0 ,
42194237 ),
42204238 output_tokens = 15 ,
42214239 output_tokens_details = OutputTokensDetails (
@@ -4391,6 +4409,7 @@ async def test_invoke_agent_span_includes_response_model(
43914409 input_tokens = 10 ,
43924410 input_tokens_details = InputTokensDetails (
43934411 cached_tokens = 0 ,
4412+ cache_write_tokens = 0 ,
43944413 ),
43954414 output_tokens = 20 ,
43964415 output_tokens_details = OutputTokensDetails (
@@ -4539,6 +4558,7 @@ def calculator(a: int, b: int) -> int:
45394558 input_tokens = 10 ,
45404559 input_tokens_details = InputTokensDetails (
45414560 cached_tokens = 0 ,
4561+ cache_write_tokens = 0 ,
45424562 ),
45434563 output_tokens = 5 ,
45444564 output_tokens_details = OutputTokensDetails (
@@ -4578,6 +4598,7 @@ def calculator(a: int, b: int) -> int:
45784598 input_tokens = 20 ,
45794599 input_tokens_details = InputTokensDetails (
45804600 cached_tokens = 0 ,
4601+ cache_write_tokens = 0 ,
45814602 ),
45824603 output_tokens = 15 ,
45834604 output_tokens_details = OutputTokensDetails (
@@ -4922,6 +4943,7 @@ async def test_streaming_ttft_on_chat_span(
49224943 input_tokens = 20 ,
49234944 input_tokens_details = InputTokensDetails (
49244945 cached_tokens = 5 ,
4946+ cache_write_tokens = 0 ,
49254947 ),
49264948 output_tokens = 10 ,
49274949 output_tokens_details = OutputTokensDetails (
@@ -5183,6 +5205,7 @@ def simple_tool(message: str) -> str:
51835205 input_tokens = 10 ,
51845206 input_tokens_details = InputTokensDetails (
51855207 cached_tokens = 0 ,
5208+ cache_write_tokens = 0 ,
51865209 ),
51875210 output_tokens = 5 ,
51885211 output_tokens_details = OutputTokensDetails (
@@ -5222,6 +5245,7 @@ def simple_tool(message: str) -> str:
52225245 input_tokens = 20 ,
52235246 input_tokens_details = InputTokensDetails (
52245247 cached_tokens = 5 ,
5248+ cache_write_tokens = 0 ,
52255249 ),
52265250 output_tokens = 10 ,
52275251 output_tokens_details = OutputTokensDetails (
@@ -5627,6 +5651,7 @@ async def test_runner_run_streamed_with_starting_agent_kwarg(
56275651 input_tokens = 10 ,
56285652 input_tokens_details = InputTokensDetails (
56295653 cached_tokens = 0 ,
5654+ cache_write_tokens = 0 ,
56305655 ),
56315656 output_tokens = 20 ,
56325657 output_tokens_details = OutputTokensDetails (
0 commit comments