emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/elisa 48d96a9716 27/98: Merge pull request #5 from s-ko


From: ELPA Syncer
Subject: [elpa] externals/elisa 48d96a9716 27/98: Merge pull request #5 from s-kostyaev/fix-load-file
Date: Wed, 17 Jul 2024 18:58:01 -0400 (EDT)

branch: externals/elisa
commit 48d96a97163611670d395db72515433c0c41094e
Merge: 05efc8eb0d 7f5a5fff5d
Author: Sergey Kostyaev <s-kostyaev@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #5 from s-kostyaev/fix-load-file
    
    Fix load file
---
 .github/workflows/melpa.yml |  4 +---
 NEWS.org                    |  2 ++
 README.org                  |  4 ++++
 elisa.el                    | 35 ++++++++++++++++++-----------------
 4 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/.github/workflows/melpa.yml b/.github/workflows/melpa.yml
index ab0271521c..bc265616ee 100644
--- a/.github/workflows/melpa.yml
+++ b/.github/workflows/melpa.yml
@@ -27,9 +27,7 @@ jobs:
         warnings_as_errors:
           - false
         check:
-          - byte-compile
-          - checkdoc
-          - package-lint
+          - melpa
         file:
           - elisa.el
     # Steps represent a sequence of tasks that will be executed as part of the 
job
diff --git a/NEWS.org b/NEWS.org
index 558d38d603..5c8dd015da 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,5 @@
+* Version 0.1.2
+- Warn user instead of network call during package loading.
 * Version 0.1.1
 - Refactor asyncronous parsing to fix alterantive installation ways.
 * Version 0.1.0
diff --git a/README.org b/README.org
index 28a9aed2af..f37804a6a3 100644
--- a/README.org
+++ b/README.org
@@ -28,6 +28,10 @@ archives soon. For now you can use ~package-vc~ to install 
ELISA:
   (package-vc-install "https://github.com/s-kostyaev/elisa";)
 #+end_src
 
+Then you need to download ~sqlite-vss~. You can do it manually from
+https://github.com/asg017/sqlite-vss/releases or by calling ~M-x~
+~elisa-download-sqlite-vss~.
+
 You can use this package with different llm providers. By default it
 uses [[https://github.com/jmorganca/ollama][ollama]] provider both for 
embeddings and chat. If you ok with it,
 you need to install [[https://github.com/jmorganca/ollama][ollama]] and pull 
used models:
diff --git a/elisa.el b/elisa.el
index 948a59ff71..fd605d4492 100644
--- a/elisa.el
+++ b/elisa.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/s-kostyaev/elisa
 ;; Keywords: help local tools
 ;; Package-Requires: ((emacs "29.2") (ellama "0.8.6") (llm "0.9.1") (async 
"1.9.8"))
-;; Version: 0.1.1
+;; Version: 0.1.2
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;; Created: 18th Feb 2024
 
@@ -27,19 +27,19 @@
 ;;
 ;; ELISA (Emacs Lisp Information System Assistant) is a project
 ;; designed to help Emacs users quickly find answers to their
-;; questions related to Emacs and Emacs Lisp. Utilizing the powerful
+;; questions related to Emacs and Emacs Lisp.  Utilizing the powerful
 ;; Ellama package, ELISA provides accurate and relevant responses to
 ;; user queries, enhancing productivity and efficiency in the Emacs
-;; environment. By integrating links to the Emacs info manual after
+;; environment.  By integrating links to the Emacs info manual after
 ;; answering a question, ELISA ensures that users have easy access to
 ;; additional information on the topic, making it an essential tool
 ;; for both beginners and advanced Emacs users.
 ;;
-;; ELISA creates index from info manuals. When you send message to
+;; ELISA creates index from info manuals.  When you send message to
 ;; `elisa-chat' it search to semantically similar info nodes in index,
 ;; get first `elisa-limit' nodes, add it to context and send your
-;; message to llm. LLM generates answer to your message based on
-;; provided context. You can read not only answer generated by llm,
+;; message to llm.  LLM generates answer to your message based on
+;; provided context.  You can read not only answer generated by llm,
 ;; but also info manuals by provided links.
 ;;
 
@@ -139,7 +139,8 @@
     (make-directory elisa-db-directory t)
     (url-copy-file (elisa-sqlite-vss-download-url) file-name t)
     (process-lines elisa-tar-executable "-xf" file-name)
-    (delete-file file-name)))
+    (delete-file file-name))
+  (elisa--reopen-db))
 
 (defun elisa-get-embedding-size ()
   "Get embedding size."
@@ -156,16 +157,16 @@
 
 (defun elisa--init-db (db)
   "Initialize elisa DB."
-  (when (not (file-exists-p (elisa--vss-path)))
-    (elisa-download-sqlite-vss))
-  (sqlite-load-extension
-   db
-   (elisa--vector-path))
-  (sqlite-load-extension
-   db
-   (elisa--vss-path))
-  (sqlite-execute db (elisa-embeddings-create-table-sql))
-  (sqlite-execute db (elisa-info-create-table-sql)))
+  (if (not (file-exists-p (elisa--vss-path)))
+      (warn "Please run M-x `elisa-download-sqlite-vss' to use this package")
+    (sqlite-load-extension
+     db
+     (elisa--vector-path))
+    (sqlite-load-extension
+     db
+     (elisa--vss-path))
+    (sqlite-execute db (elisa-embeddings-create-table-sql))
+    (sqlite-execute db (elisa-info-create-table-sql))))
 
 (defvar elisa-db (progn
                   (make-directory elisa-db-directory t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]