Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type argument: ellama-session, nil #85

Closed
mberrueta opened this issue Mar 1, 2024 · 6 comments
Closed

Wrong type argument: ellama-session, nil #85

mberrueta opened this issue Mar 1, 2024 · 6 comments

Comments

@mberrueta
Copy link

Hello! im using emacs 29 on linux
GNU Emacs 29.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2024-02-27 (With doom if Mathers)

Im running Ollama with docker (im able to call by curl without any problem)

HTTP POST http://localhost:11434/api/generate Headers:[((Content-Type . application/json))] Body:[{
  "model": "zephyr",
  "stream": false,
  "prompt": "Why is the sky blue?"
}]

I didn't set any config.
So if I run

  • llama-chat I get or: Wrong type argument: ellama-session, nil
  • ellama-get-ollama-local-mode -> process-lines-handling-status: Wrong type argument: stringp, nil
  • llama-provider-select -> llama2 and then ellama-chat -> File mode specification error: (wrong-type-argument listp keymap)

It seems that there are wrong init things?

 head ellama.el
;;; ellama.el --- Tool for interacting with LLMs -*- lexical-binding: t -*-

;; Copyright (C) 2023  Free Software Foundation, Inc.

;; Author: Sergey Kostyaev <[email protected]>
;; URL: http://github.com/s-kostyaev/ellama
;; Keywords: help local tools
;; Package-Requires: ((emacs "28.1") (llm "0.6.0") (spinner "1.7.4") (dash "2.19.1"))
;; Version: 0.8.10
;; SPDX-License-Identifier: GPL-3.0-or-later
@mberrueta
Copy link
Author

btw, removed the package install from doom, and installed manually

so version

;;; ellama.el --- Tool for interacting with LLMs -*- lexical-binding: t -*-

;; Copyright (C) 2023  Free Software Foundation, Inc.

;; Author: Sergey Kostyaev <[email protected]>
;; URL: http://github.com/s-kostyaev/ellama
;; Keywords: help local tools
;; Package-Requires: ((emacs "28.1") (llm "0.6.0") (spinner "1.7.4") (dash "2.19.1"))
;; Version: 0.8.10
;; SPDX-License-Identifier: GPL-3.0-or-later
;; Created: 8th Oct 2023

and run:

  • ellama-chat -> funcall-interactively: Wrong type argument: ellama-session, nil

but after restart emacs im not able to call llama any more. (still appear as installed, but the command is not available)

@mberrueta
Copy link
Author

  ellama                         20240225.1803  installed             Tool for interacting with LLMs
  dash                           20240103.1301  dependency            A modern list library for Emacs
  llm                            0.9.1          dependency            Interface to pluggable llm backends
  spinner                        1.7.4          dependency            Add spinners and progress-bars to the mode-line for ongoing operations

@s-kostyaev
Copy link
Owner

s-kostyaev commented Mar 1, 2024

Hi @mberrueta

Try to M-x toggle-debug-on-error and reproduce an error. And paste debugger output here.

@mberrueta
Copy link
Author

mberrueta commented Mar 21, 2024

not sure why I dint get GH notifications, sorry man

is a emacs on the terminal btw, headless linux

  signal(wrong-type-argument (ellama-session nil))
  (or (progn (and (memq (type-of session) cl-struct-ellama-session-tags) t)) (signal 'wrong-type-argument (list 'ellama-session session)))
  (progn (or (progn (and (memq (type-of session) cl-struct-ellama-session-tags) t)) (signal 'wrong-type-argument (list 'ellama-session session))) (aref session 1))
  (ellama-get-session-buffer (progn (or (progn (and (memq (type-of session) cl-struct-ellama-session-tags) t)) (signal 'wrong-type-argument (list 'ellama-session session))) (aref session 1)))
  (let* ((providers (append (list '("default model" . ellama-provider) (if (and ellama-ollama-binary (file-exists-p ellama-ollama-binary)) '("ollama model" ellama-get-ollama-local-model))) ellama-providers)) (variants (mapcar #'car providers)) (provider (if current-prefix-arg (eval (alist-get (completing-read "Select model: " variants) providers nil nil #'string=)) (or (plist-get args :provider) ellama-provider))) (session (if (or create-session current-prefix-arg (and (not ellama--current-session) (not ellama--current-session-id))) (ellama-new-session provider prompt) (or ellama--current-session (save-current-buffer (set-buffer (ellama-get-session-buffer ellama--current-session-id)) ellama--current-session)))) (buffer (ellama-get-session-buffer (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 1)))) (file-name (progn (or (progn (and (memq ... cl-struct-ellama-session-tags) t)) (signal 'wrong-type-argument (list 'ellama-session session))) (aref session 3))) (translation-buffer (if ellama-chat-translation-enabled (progn (if file-name (progn (find-file-noselect ...)) (get-buffer-create (progn ... ...))))))) (if ellama-chat-translation-enabled (ellama--translate-interaction prompt translation-buffer buffer session) (display-buffer buffer) (save-current-buffer (set-buffer buffer) (save-excursion (goto-char (point-max)) (insert (ellama-get-nick-prefix-for-mode) " " ellama-user-nick ":\n" (ellama--format-context session) prompt "\n\n" (ellama-get-nick-prefix-for-mode) " " ellama-assistant-nick ":\n") (ellama-stream prompt :session session :on-done #'ellama-chat-done :filter (if (derived-mode-p 'org-mode) (progn #'ellama--translate-markdown-to-org-filter)))))))
  ellama-chat("why the sky is blue")
  funcall-interactively(ellama-chat "why the sky is blue")
  command-execute(ellama-chat record)
  execute-extended-command(nil "ellama-chat" nil)
  funcall-interactively(execute-extended-command nil "ellama-chat" nil)
  command-execute(execute-extended-command)

@s-kostyaev
Copy link
Owner

@mberrueta Unfortunately I have no idea what's the reason of this issue. Can you still reproduce it?

@s-kostyaev
Copy link
Owner

looks like #144 is the reason of this issue.
@mberrueta fix will be in #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants