Closed NightMachinery closed 5 months ago
@NightMachinery What would you like to see in the log for it to be useful?
Anything else? System messages can be quite long (> 1000 words, example) so I'm not sure it's convenient to log these.
@karthink Thanks. All of the above are useful, but the response matters less to me. I can easily notice a failed response anyway.
Cost of each interaction would be a welcome addition.
I like to see a complete prompt (with the system message) for each request, even if it’s very long. Indeed, I would most probably change the system prompt if it’s too long as that would be very expensive. I don’t think a cluttered log file is too big of a problem. I would only look at it for diagnostics anyway.
One way to reduce the clutter in the log file is to have a directory of log files and create a new file for each interaction, using the datetime + a random number for the file name. A command gptel-open-last-log will open the most recent interaction’s log file.
Logging support added:
gptel-log-level
to info
or debug
, which see.*gptel-log*
buffer.Log entries are in JSON but with one exception -- Streaming responses are typically not provided as valid JSON and logged as-is. If you want to parse the log buffer programmatically, your JSON parser should be able to work around this.
@NightMachinery: feedback welcome!
With these kinds of extensions, one cannot be sure what context, system prompt, temperature, etc. are being used in any given interaction. Logging all the interactions can be helpful for diagnostics and making sure the behavior one is expecting is actually happening.
E.g., it seems using
GPTEL_MODEL
changes the model for current subheading, andGPTEL_TOPIC
starts a new conversation from that point onwards. But this is just a guess on the user's part, and it's hard to verify.