Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anthropic[patch]: Apply the new format for transferring the "usage" attribute in the "m… #4877

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

rechik
Copy link
Contributor

@rechik rechik commented Mar 25, 2024

…essage_delta" event of the "anthropic" provider.

Apparently, anthropic has moved "usage" out of "delta", placing them now on the same level. Here is the current view of the event.

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":12} }

…essage_delta" event of the "anthropic" provider.

Apparently, anthropic has moved "usage" out of "delta", placing them now on the same level. Here is the current view of the event.

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":12}         }
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 25, 2024
Copy link

vercel bot commented Mar 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2024 5:56am
langchainjs-docs ✅ Ready (Inspect) Visit Preview Mar 26, 2024 5:56am

@jacoblee93
Copy link
Collaborator

Nice catch, thank you!

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Mar 26, 2024
@jacoblee93 jacoblee93 changed the title Apply the new format for transferring the "usage" attribute in the "m… anthropic[patch]: Apply the new format for transferring the "usage" attribute in the "m… Mar 26, 2024
@jacoblee93 jacoblee93 merged commit 64041db into langchain-ai:main Mar 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants