xenodium / chatgpt-shell

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

curl error when swapping to o1-preview #261

Open mikaelspringer opened 2 days ago

mikaelspringer commented 2 days ago

When I swap model from 4o to o1-preview I get a curl error as can be seen below;

Welcome to ChatGPT shell

  Type help and press RET for details.

  Like this package? Consider ✨sponsoring✨

ChatGPT(chatgpt-4o-latest/Programming)> who made you?
I was created by OpenAI.

ChatGPT(chatgpt-4o-latest/Programming)> 

ChatGPT(o1-preview/Programming)> who made you?

curl: (22) The requested URL returned error: 400Unsupported value: 'messages[0].role' does not support 'system' with this model.

ChatGPT(o1-preview/Programming)> 

My configuration looks like this;

(use-package chatgpt-shell
  :ensure t
  :bind
  (:map global-map
    ("s-i c" . chatgpt-shell)
    ("s-i x" . chatgpt-shell-explain-code))
  :custom
  (chatgpt-shell-openai-key 'ms-get-openai-api-key)
  ;; gpt-4o.
  (chatgpt-shell-model-version 0)
  (chatgpt-shell-system-prompt 2))
xenodium commented 2 days ago

Have look at https://github.com/xenodium/chatgpt-shell/issues/256#issuecomment-2501609341

I'll see if I can introduce additional validation to provide a friendlier error which tells one how to fix it.

xenodium commented 2 days ago

Ok. Added in https://github.com/xenodium/chatgpt-shell/commit/22d4edcb94722aa90db5041fa6be3cc1224fabf6

Screenshot 2024-11-28 at 10 40 52