xenodium / chatgpt-shell

A multi-llm Emacs shell (ChatGPT, Claude, Gemini, Ollama, Perplexity) + editing integrations
https://lmno.lol/alvaro
GNU General Public License v3.0
867 stars 77 forks source link

Print the process error message for user #105

Closed stardiviner closed 1 year ago

stardiviner commented 1 year ago

https://github.com/xenodium/chatgpt-shell/blob/4e117234f07991a1f1d100be84fbf2f4689ae39d/chatgpt-shell.el#LL1276C6-L1276C6

When in ob-chatgpt-shell, sometimes there is no result and no error printed. Just from ob-core.el high level return message Code block produced no output (took 10.0s)..

So I suggest to print process error message in *Message* buffer. Also, print the whole command is useful for debugging too.

(let ((print-length 100)
      (command '("curl" "https://api.openai.com/v1/chat/completions" "--fail-with-body" "--no-progress-meter" "-m" "600" "-H" "Content-Type: application/json" "-H" "Authorization: Bearer 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" "-d" "{\"model\":\"gpt-3.5-turbo\",\"messages\":[{\"role\":\"system\",\"content\":\"always respond like a pirate\"},{\"role\":\"user\",\"content\":\"hello\"}]}")))
  (print command))
xenodium commented 1 year ago

Thanks for filing this. I've just pushed 26142da so it logs the sync curl command just like the async version. To view the curl command, (setq chatgpt-shell-logging t).