ahyatt / ekg

The emacs knowledge graph, app for notes and structured data.
GNU General Public License v3.0
224 stars 18 forks source link

`(ekg-capture-finialize)` fails without LLM provider #102

Closed maxtrussell closed 11 months ago

maxtrussell commented 11 months ago

When using the provided example configuration from the README:

(use-package ekg
  :bind (([f11] . ekg-capture)))

Calling (ekg-capture-finialize) from a an ekg capture buffer fails, requiring me to set an LLM provider:

Debugger entered--Lisp error: (error "LLM provider was nil.  Please set the provider in ...")
  signal(error ("LLM provider was nil.  Please set the provider in ..."))
  triples--with-transaction(#<sqlite db=0x55dce80570e8 name=/home/maxtrussell/.emacs.d/triples.db> #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_59>)
  ekg--save-note-in-buffer()
  #<subr ekg-capture-finalize>()
  apply(#<subr ekg-capture-finalize> nil)
  #f(compiled-function (body &rest args) #<bytecode -0x80dd22094e3b867>)(#<subr ekg-capture-finalize>)
  apply(#f(compiled-function (body &rest args) #<bytecode -0x80dd22094e3b867>) #<subr ekg-capture-finalize> nil)
  ekg-capture-finalize()
  eval-expression((ekg-capture-finalize) nil nil 127)
  funcall-interactively(eval-expression (ekg-capture-finalize) nil nil 127)
  command-execute(eval-expression)

Full error message:

triples--with-transaction: LLM provider was nil. Please set the provider in the application you are using

I would prefer not to use an LLM to manage my notes (sacrificing any associated features) . Is it possible to use ekg without an LLM provider?

Thanks in advance!

ahyatt commented 11 months ago

Somehow you are loading ekg-embedding, which installs itself automatically. Probably that's a bad idea, and I can fix it. But for the time being you may want to find out how you are loading that module, and stop. It won't be loaded by ekg automatically.

maxtrussell commented 11 months ago

Interesting, thanks for the quick response!

Checking my load-history it looks like ekg-embedding is loaded whenever I install ekg.

However if I restart emacs, then only ekg will be loaded and (ekg-capture-finalize) works without issues.

Is it possible that ekg-embedding is loaded automatically as part of the install process?

ahyatt commented 11 months ago

I think the recent commit into the develop branch should fix this. Indeed, I also tried this out and noticed that installing the package loads all the files, which is not great for the majority of people who have not set up embeddings. That should fix this issue, but if it doesn't please re-open this.

I'll release this as a new version soon.