[Bugfix] Add Responses cache_write_tokens for API compat and CC parity (#57222)

Signed-off-by: Yifan Zong <yzong@redhat.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
yzong-rh
2026-09-16 21:52:34 +00:00
committed by GitHub
co-authored by Flora Feng
parent 929aa2a7ed
commit 5a6ccc5892
5 changed files with 17 additions and 0 deletions
@@ -837,6 +837,7 @@ class OpenAIServingResponses(GenerateBaseServing):
output_tokens=num_generated_tokens,
total_tokens=num_prompt_tokens + num_generated_tokens,
input_tokens_details=InputTokensDetails(
cache_write_tokens=getattr(context, "num_cache_creation_tokens", 0),
cached_tokens=num_cached_tokens,
input_tokens_per_turn=[
turn.input_tokens for turn in context.all_turn_metrics