Skip to content

Conversation

@guillaumefrd
Copy link

This PR is to patch the read/write cache tokens that were missing from the trace when using anthropic streaming (with client.messages.create(..., stream=True) or client.messages.stream(...))

@guillaumefrd guillaumefrd requested a review from a team as a code owner September 26, 2025 08:48
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@guillaumefrd
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Sep 26, 2025
@axiomofjoy axiomofjoy changed the title Count read/write cache tokens with anthropic streaming fix(anthropic): add read/write cache tokens with anthropic streaming Sep 30, 2025
@axiomofjoy axiomofjoy changed the title fix(anthropic): add read/write cache tokens with anthropic streaming fix(anthropic): ensure read/write cache tokens are recorded with streaming methods Sep 30, 2025
@axiomofjoy
Copy link
Contributor

Thanks @guillaumefrd, can you add a unit test to verify that the cache tokens are successfully recorded?

@nate-mar
Copy link
Contributor

Hi @guillaumefrd ! let us know if you need any assistance here; happy to take it across the line if you don't have bandwidth. Thanks again for the contribution; we really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants