Closed beyondpie closed 1 year ago
when I plan to use chatgpt, it says no openai. Later I found that it depends on this repo. But seems like we cannot use use-package to install this package?
The package is NOT on MELPA, so that's why. You would have to use JCS-ELPA instead.
Furthermore, is that possible to use API-KEY like this? Typically we don't want to expose our KEY, but the way in this package to hide key seems a little bit difficult for me (sorry that I am not that familiar with Emacs)...
The standard way to store keys/secrets in Emacs is through auth-source
. See our README.md you will find:
(setq openai-key #'openai-key-auth-source)
or just getenv:
(setq openai-key #(getenv "OPENAI_API_KEY")) ; You can name whatever you want!
P.S. It's a bit hard to use auth-source
the first time, but it's the standard in Emacs.
Thanks for the comments.
;; under Emacs >= 29.1
(cl-defun slot/vc-install (&key (fetcher "github") repo name rev backend)
(use-package openai
:init (slot/vc-install :fetcher "github" :repo "emacs-openai/openai"))
I use this method to install chatgpt, but did not work on openai. I will try it again then.
Thanks! Songpeng
If you are using striaght.el:
(use-package openai
:straight (openai :type git :host github :repo "emacs-openai/openai"))
Why did you close it? Did you manage to solve it? 🤔
Hi, I can now install openai. I don't know, it just works. But M-x chatgpt, and insert "hi", will have 404 error.... I have insert my token and bought GPT service. So I just give it up, and use it in the browser...
But thank you so much for your responses! You are really patient. I also notice that you are one of the authors of emacs tree-sitter. That's a really great package!
But M-x chatgpt, and insert "hi", will have 404 error.... I have insert my token and bought GPT service.
Try our debugging section, see https://github.com/emacs-openai/openai#-debugging. It should give you detailed information! 🤔
But thank you so much for your responses! You are really patient. I also notice that you are one of the authors of emacs tree-sitter. That's a really great package!
Thank you! ❤️ But I am not the author of emacs tree-sitter, I did contribute a little but mainly because of the package ts-fold.
Hi there,
when I plan to use chatgpt, it says no openai. Later I found that it depends on this repo. But seems like we cannot use
use-package
to install this package?Furthermore, is that possible to use API-KEY like this? Typically we don't want to expose our KEY, but the way in this package to hide key seems a little bit difficult for me (sorry that I am not that familiar with Emacs)...
Thanks! Songpeng