fix(core): patch usage data tracking for anthropic when context caching is on (#6997)

This commit is contained in:
Charles Packer
2025-12-14 18:14:09 -08:00
committed by Caren Thomas
parent a731e01e88
commit 33d39f4643
4 changed files with 46 additions and 8 deletions

View File

@@ -200,7 +200,7 @@ class SimpleLLMStreamAdapter(LettaLLMStreamAdapter):
self.usage = LettaUsageStatistics(
step_count=1,
completion_tokens=output_tokens or 0,
prompt_tokens=input_tokens or 0,
prompt_tokens=actual_input_tokens,
total_tokens=actual_input_tokens + (output_tokens or 0),
cached_input_tokens=cached_input_tokens,
cache_write_tokens=cache_write_tokens,