You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add prompt caching support (Anthropic cache_control + OpenAI cached_tokens)
- Add CacheControl struct and optional cacheControl field to Message
- Add cacheCreationTokens and cacheReadTokens fields to Usage
- Anthropic: serialize system prompt as content blocks array with cache_control ephemeral
- Anthropic: add cache_control on last tool definition for prompt caching
- Anthropic: parse cache_creation_input_tokens and cache_read_input_tokens from usage (both streaming and non-streaming)
- OpenAI: add stream_options include_usage for accurate token counting in streams
- OpenAI: parse cached_tokens from prompt_tokens_details in usage
- Version bump to 0.2.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments