-
Notifications
You must be signed in to change notification settings - Fork 2.4k
included usage logging for openai calls #211
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
Conversation
|
Looks great. Can we just activate logging only when dsp.settings.log_openai_usage is True? |
|
Now it will crash I think? We need the new dsp.settings flag to be set to False by default |
|
otherwise it will complain that it's unset |
|
Thanks for the feature! Adding I would suggest adding some explanation here, e.g. |
|
This is what I change in my dsp/utils/settings.py: |
ah yes I was going to keep this but looking at this example on how users can set flags without including this in the settings and also since the settings getattr method would check for variables in the config dictionary, I thought dsp.settings would handle this itself. But adding the flag is definitely the simpler solution :) |
-logging of total_tokens usage from OpenAI requests
-thread-safe with Python logging library