Exafunction / codeium.el

Free, ultrafast Copilot alternative for Emacs
https://www.codeium.com
MIT License
483 stars 18 forks source link

How do I get my api key? #115

Open kanodiaayush opened 2 months ago

kanodiaayush commented 2 months ago

I'm trying to find my api key on codeium.com but cannot. Where should I look?

kanodiaayush commented 2 months ago

I see the following error trace. This is upon M-x codeium-install. The binary seems to be downloaded correctly, but I think its trying to authenticate after that, and that doesn't work. I'm in doom emacs.

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 3) 5)
  read-multiple-choice("No Codeium API key found. Authenticate manually or..." ((manual "manual") (auto "auto")) nil nil t)
  codeium-background-process-start(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>))
  codeium-install-process-url-res(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) "https://github.com/Exafunction/codeium/releases/do..." #<killed buffer> "/Users/akanodia/doom-emacs/.local/cache/codeium/co...")
  #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>)()
  apply(#f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil)
  codeium-defer-until-no-input(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) default43 #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil)
  apply(codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) default43 #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil))
  timer-event-handler([t 26309 16944 560398 nil codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) default43 #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil) nil 0 nil])
svetlyak40wt commented 2 weeks ago

Encountered the similar error on GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu) of 2022-05-31:

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 3) 5)
  read-multiple-choice("No Codeium API key found. Authenticate manually or..." ((manual "manual") (auto "auto")) nil nil t)
  (car (read-multiple-choice "No Codeium API key found. Authenticate manually or..." '((manual "manual") (auto "auto")) nil nil t))
  (let* ((login-method (car (read-multiple-choice "No Codeium API key found. Authenticate manually or..." '((manual "manual") (auto "auto")) nil nil t))) (authurl (codeium-make-auth-url codeium-state nil login-method))) (if (eq login-method 'auto) (progn (browse-url authurl) (codeium-request 'GetAuthToken state nil #'(lambda (res) (let* (...) (if token ... ...)) (codeium-background-process-schedule state))) (message "you can also use M-x codeium-kill-last-auth-url to...")) (kill-new authurl) (progn (or (progn (and (memq (type-of state) cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (let* ((v state)) (aset v 8 (read-string (format "%s has been copied to clipboard.\nAfter you login, ..." authurl))))) (codeium-background-process-schedule state)))
  (cond ((and (progn (or (progn (and (memq ... cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (aref state 3)) (not (process-live-p (progn (or (progn ...) (signal ... ...)) (aref state 3))))) (codeium-reset state)) ((and (not (codeium-get-config 'codeium-port nil state)) (not (codeium-get-config 'codeium-directory nil state)) (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 3)))) (progn (or (progn (and (memq (type-of state) cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (let* ((v state)) (aset v 5 nil))) (let* ((dir (and t (progn (or ... ...) (aref state 4))))) (if dir (progn (delete-directory dir t) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 4 nil)))) nil)) (codeium-create-process state) (codeium-background-process-schedule state)) ((not (codeium-get-config 'codeium-port nil state)) (if (codeium-get-config 'codeium-directory nil state) nil (error "no manager directory defined")) (let ((files (directory-files (codeium-get-config 'codeium-directory nil state) nil "^[[:digit:]]*$"))) (if files (progn (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 5 ...))) (mapc #'(lambda ... ...) (progn (or ... ...) (aref state 6))))) (codeium-background-process-schedule state))) ((and (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 8))) (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 9))) (not (codeium-get-config 'codeium/metadata/api_key 'GetCompletions state))) (let* ((login-method (car (read-multiple-choice "No Codeium API key found. Authenticate manually or..." '... nil nil t))) (authurl (codeium-make-auth-url codeium-state nil login-method))) (if (eq login-method 'auto) (progn (browse-url authurl) (codeium-request 'GetAuthToken state nil #'(lambda ... ... ...)) (message "you can also use M-x codeium-kill-last-auth-url to...")) (kill-new authurl) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (let* ((v state)) (aset v 8 (read-string ...)))) (codeium-background-process-schedule state)))) ((and (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 9))) (not (codeium-get-config 'codeium/metadata/api_key 'GetCompletions state))) (codeium-request 'RegisterUser state nil #'(lambda (res) (let* ((key ...)) (if key (progn ... ...) (error "cannot get api_key from res"))) (codeium-background-process-schedule state)))) (t (codeium-request 'Heartbeat state nil #'(lambda (_res) (codeium-run-with-timer state 5 #'codeium-background-process-start state)))))
  codeium-background-process-start(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))
  apply(codeium-background-process-start #s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))
  (let ((inhibit-quit nil)) (apply func args))
  (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil))))
  (if (input-pending-p) (run-with-idle-timer 0.005 nil #'codeium-defer-until-no-input state tracker func args) (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil)))))
  (progn (if (input-pending-p) (run-with-idle-timer 0.005 nil #'codeium-defer-until-no-input state tracker func args) (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil))))))
  (if (eq tracker (progn (or (progn (and (memq (type-of state) cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (aref state 7))) (progn (if (input-pending-p) (run-with-idle-timer 0.005 nil #'codeium-defer-until-no-input state tracker func args) (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil)))))))
  codeium-defer-until-no-input(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>) default612 codeium-background-process-start (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>)))
  apply(codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>) default612 codeium-background-process-start (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))))
  timer-event-handler([t 26386 53620 986393 nil codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>) default612 codeium-background-process-start (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))) nil 645000 nil])