s-kostyaev / ellama

Ellama is a tool for interacting with large language models from Emacs.
GNU General Public License v3.0
359 stars 25 forks source link

Wrong type argument: ellama-session, nil on some commands #75

Closed sqlambda closed 4 months ago

sqlambda commented 4 months ago

Wrong type argument: ellama-session, nil is a message that keeps showing on some commands after installing the package

ollama zephyr is available and runs on local:

daniel@ws01:~/ $ ollama run zephyr
>>> what is python?
Python is a widely-used, high-level, general-purpose programming language. It is known for its readability and simplicity, making it an ideal choice for beginners as well as experienced developers. Python 
can be used to create various types of software applications, ranging from simple scripts to complex web applications and scientific computing programs. Its versatility and extensive library support make 
it a popular choice in many industries, including finance, data analysis, science, and education. Some popular applications built using Python include Google, YouTube, and Instagram. Overall, Python offers
a lot of benefits such as simplicity, readability, versatility, and vast libraries that make it an excellent choice for various purposes.

>>> /exit

Some that didn't work: ellama-code-review ellama-code-improve ellama-improve-grammar ellama-change

Some that worked: ellama-ask-about ellama-ask-selection

s-kostyaev commented 4 months ago

@sqlambda thank you for report. I will investigate it.

sqlambda commented 4 months ago
daniel@ws01:~ $ emacs --version
GNU Emacs 28.2
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.`
s-kostyaev commented 4 months ago

Should be fixed in 0.8.3

ph-rast commented 4 months ago

@s-kostyaev it looks like something is not working for me. In version 0.8.2 I got the ellama-session, nil error when calling ellama-code-.... Now, in version 0.8.3, the call does not return an error but the request still runs into an error somewhere.

Here's the output of the emacs debugger (debug-on-entry "ellama-code-add") in case that helps?

Debugger entered--entering a function:                                                                                                                                                                                                                                                                                    
   * region-active-p()                                                                                                                                                                                                                                                                                                       
   * #<subr ellama-code-add>("read a file in R")                                                                                                                                                                                                                                                                             
   * apply(#<subr ellama-code-add> "read a file in R")                                                                                                                                                                                                                                                                       
   * ellama-code-add("read a file in R")                                                                                                                                                                                                                                                                                     
     funcall-interactively(ellama-code-add "read a file in R")                                                                                                                                                                                                                                                               
     command-execute(ellama-code-add record)                                                                                                                                                                                                                                                                                 
     execute-extended-command(nil "ellama-code-add" "ellama-code-add")                                                                                                                                                                                                                                                       
     funcall-interactively(execute-extended-command nil "ellama-code-add" "ellama-code-add")                                                                                                                                                                                                                                 
    command-execute(execute-extended-command)
s-kostyaev commented 4 months ago

@ph-rast thank you for report, I will check it at the weekend.

ph-rast commented 4 months ago

@s-kostyaev Ok - this might be helpful: If I want to use ellama-code-... I have to first select a provider with ellama-provider-select. Only then things like ellama-code-add will work. I don't have to do this with other functions like ellama-chat.

Thanks for this awesome package btw!

s-kostyaev commented 4 months ago

@ph-rast Could you provide more details, please? I can't reproduce your problem.

s-kostyaev commented 4 months ago

@ph-rast looks like your problem not related to original issue. Please open new issue and provide more details how to reproduce it.