dspy
dspy copied to clipboard
Fix: Add logging path modification for OpenAI usage
This is to ensure that extraneous files are created in specified folder.
Refer to #211
Thanks a lot. I think this may not work because it will not allow the user to ever turn on the cache after import?
Hmm, I see. What are your opinions of using an env_var here: either to prefix the logging files to a specific folder, or to enable/disable?
I was thinking maybe something like DSPY_USAGE_LOGGING_DIR
to prefix a folder to save logs, or DSPY_USAGE_LOGGING
to enable/disable logging.
@okhat I updated the PR to focus on just giving the user the ability to specify a folder to save logs to — the mechanism to allow enabling/disabling of logging seems more complicated, but this should provide some level on configurability on where logs are stored.
I've added an initial global logger, with configuration here: #684. Does the API offered in that PR, cover all the uses outlined here?
I've added an initial global logger, with configuration here: #684. Does the API offered in that PR, cover all the uses outlined here?
Yup, looks perfect — thanks so much!