Skip to content

feat: add cache-token fields to set_usage - #65

Merged
PabloPardoGarcia merged 1 commit into
mainfrom
pablo/rius-541-cache-token-usage
Sep 1, 2026
Merged

feat: add cache-token fields to set_usage#65
PabloPardoGarcia merged 1 commit into
mainfrom
pablo/rius-541-cache-token-usage

Conversation

@PabloPardoGarcia

Copy link
Copy Markdown
Member

RIUS-541 (Python half; TS mirror in rius-sdk-typescript).

Extends Generation.set_usage with two optional fields for cache-read and cache-creation input tokens, emitted as gen_ai.usage.cache_read.input_tokens / gen_ai.usage.cache_creation.input_tokens per OTel GenAI semconv.

Per the convention, gen_ai.usage.input_tokens is the total including cached tokens (cache counts are subsets). Callers pass provider-reported values as-is; the sink normalizes Anthropic's exclusive input_tokens (core sub-ticket).

Tests: 228 passed, 7 skipped.

@PabloPardoGarcia
PabloPardoGarcia merged commit e1682d1 into main Sep 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant