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

Move yield of metrics chunk after generation chunk (#216) #222

Merged

Conversation

ihmaws
Copy link
Contributor

@ihmaws ihmaws commented Oct 3, 2024

backport of fix into v0.1 branch

Move yield of metrics chunk after generation chunk (#216)

  • when using mistral and streaming is enabled,the final chunk includes a stop_reason. There is nothing to say this final chunk doesn't also include some generated text. The existing implementation would result in that final chunk never getting sent back
  • this update moves the yield of the metrics chunk after the generation chunk
  • also included a change to include invocation metrics for cohere models

Closes #215

(cherry picked from commit e2c2f7c)

- when using mistral and streaming is enabled,the final chunk includes a
stop_reason. There is nothing to say this final chunk doesn't also
include some generated text. The existing implementation would result in
that final chunk never getting sent back
- this update moves the yield of the metrics chunk after the generation
chunk
- also included a change to include invocation metrics for cohere models

Closes langchain-ai#215

(cherry picked from commit e2c2f7c)
Copy link
Collaborator

@3coins 3coins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ihmaws
Thanks for submitting this. 🚀

@3coins 3coins merged commit c4bb915 into langchain-ai:v0.1 Oct 4, 2024
12 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.

2 participants