-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Added CustomOpenaiCallback to ensure exclusive access to nested data. #670
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
Added CustomOpenaiCallback to ensure exclusive access to nested data. #670
Conversation
…ccess to get_openai_callback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you it looks good, do you have idea of how to implement it for the other providers? I really would like to have it for Mistral and bedrock
🎉 This PR is included in version 1.19.0-beta.12 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.20.0-beta.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
I have taken a look at it. I tested with Mistral and outputted the number of tokens used correctly, whiteout the price. To add price we can mimic OpenAICallback class, just adding models names and cost should suffice to make the callback work in any situation. |
Ok thx, is it ok if you implement it? |
@VinciGit00 Yes, I can do that, will probably do at the end of the week. |
Ok thank you so much for the effort |
🎉 This PR is included in version 1.21.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
See #576 for a detailed explanation.