branch: externals/vecdb
commit 734ffac29721b4760286d2e6628872c3c76ef679
Author: Andrew Hyatt <ahy...@gmail.com>
Commit: Andrew Hyatt <ahy...@gmail.com>

    Fix all lint issues
---
 vecdb-chroma.el | 18 ++++++++++--------
 vecdb-qdrant.el | 24 +++++++++++-------------
 vecdb.el        | 14 +++++++-------
 3 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/vecdb-chroma.el b/vecdb-chroma.el
index bf88301c4b..3c9807bc3c 100644
--- a/vecdb-chroma.el
+++ b/vecdb-chroma.el
@@ -40,7 +40,9 @@
   (database "default"))
 
 (defun vecdb-chroma-call (provider method url-suffix &optional body sync)
-  "Make an HTTP request to the Chroma API.
+  "Make an HTTP request to the Chroma API via PROVIDER.
+METHOD is the HTTP method of the request (a symbol).
+URL-SUFFIX is the path of the URL, along with any parameters.
 If BODY is provided, it will be sent as the request body.
 SYNC indicates whether the request should be synchronous."
   (let ((url (vecdb-chroma-provider-url provider)))
@@ -87,7 +89,7 @@ SYNC indicates whether the request should be synchronous."
 
 (cl-defmethod vecdb-create ((provider vecdb-chroma-provider)
                             (collection vecdb-collection))
-  "Create a new chroma collection."
+  "Create a new COLLECTION of embeddings for PROVIDER."
   (unless (vecdb-chroma-has-tenant-p provider)
     (vecdb-chroma-call
      provider
@@ -112,7 +114,7 @@ SYNC indicates whether the request should be synchronous."
 
 (cl-defmethod vecdb-delete ((provider vecdb-chroma-provider)
                             (collection vecdb-collection))
-  "Delete a chroma collection."
+  "Delete a COLLECTION of embeddings in PROVIDER.  This should remove all 
data."
   (vecdb-chroma-call
    provider
    'delete
@@ -139,7 +141,7 @@ SYNC indicates whether the request should be synchronous."
 
 (cl-defmethod vecdb-exists ((provider vecdb-chroma-provider)
                             (collection vecdb-collection))
-  "Check if a chroma collection exists."
+  "Check if a COLLECTION exists in PROVIDER, return non-nil if it does."
   (and (vecdb-chroma-has-tenant-p provider)
        (vecdb-chroma-has-database-p provider
                                     (vecdb-chroma-provider-database provider))
@@ -158,7 +160,7 @@ SYNC indicates whether the request should be synchronous."
 (cl-defmethod vecdb-upsert-items ((provider vecdb-chroma-provider)
                                   (collection vecdb-collection)
                                   items &optional sync)
-  "Upsert items into a chroma collection."
+  "Upsert a list of `vecdb-item' objects into the COLLECTION with PROVIDER."
   (let ((url (format "/api/v2/tenants/%s/databases/%s/collections/%s/upsert"
                      (vecdb-chroma-provider-tenant provider)
                      (vecdb-chroma-provider-database provider)
@@ -175,7 +177,7 @@ SYNC indicates whether the request should be synchronous."
 (cl-defmethod vecdb-get-item ((provider vecdb-chroma-provider)
                               (collection vecdb-collection)
                               item-id)
-  "Get a single item from a chroma collection by ITEM-ID."
+  "Get items with ID from the COLLECTION with PROVIDER."
   (let* ((url (format "/api/v2/tenants/%s/databases/%s/collections/%s/get"
                       (vecdb-chroma-provider-tenant provider)
                       (vecdb-chroma-provider-database provider)
@@ -195,7 +197,7 @@ SYNC indicates whether the request should be synchronous."
 (cl-defmethod vecdb-delete-items ((provider vecdb-chroma-provider)
                                   (collection vecdb-collection)
                                   item-ids &optional sync)
-  "Delete items from a chroma collection by ITEM-IDS."
+  "Delete items with IDs from the COLLECTION with PROVIDER."
   (let ((url (format "/api/v2/tenants/%s/databases/%s/collections/%s/delete"
                      (vecdb-chroma-provider-tenant provider)
                      (vecdb-chroma-provider-database provider)
@@ -210,7 +212,7 @@ SYNC indicates whether the request should be synchronous."
 (cl-defmethod vecdb-search-by-vector ((provider vecdb-chroma-provider)
                                       (collection vecdb-collection)
                                       vector &optional limit)
-  "Search for items in a chroma collection by VECTOR."
+  "Search for items in the COLLECTION with PROVIDER that are similar to 
VECTOR."
   (let* ((url (format "/api/v2/tenants/%s/databases/%s/collections/%s/query"
                       (vecdb-chroma-provider-tenant provider)
                       (vecdb-chroma-provider-database provider)
diff --git a/vecdb-qdrant.el b/vecdb-qdrant.el
index 4b263ec84d..b4d3493282 100644
--- a/vecdb-qdrant.el
+++ b/vecdb-qdrant.el
@@ -36,7 +36,9 @@
   (api-key nil))
 
 (defun vecdb-qdrant-call (provider method url-suffix &optional body sync)
-  "Make an HTTP request to the Qdrant API.
+  "Make an HTTP request to the Qdrant API specified in PROVIDER.
+METHOD is the HTTP method of the request (a symbol).
+URL-SUFFIX is the path and optional parameters of the request.
 If BODY is provided, it will be sent as the request body.
 SYNC indicates whether the request should be synchronous."
   (let ((url (vecdb-qdrant-provider-url provider))
@@ -64,10 +66,7 @@ SYNC indicates whether the request should be synchronous."
 
 (cl-defmethod vecdb-create ((provider vecdb-qdrant-provider)
                             (collection vecdb-collection))
-  "Create a new collection in the qdrant database.
-
-COLLECTION is an `vecdb-collection' object that specifies the
-properties of the collection."
+  "Create a new COLLECTION of embeddings for PROVIDER."
   (vecdb-qdrant-call provider 'put (concat "/collections/" 
(vecdb-collection-name collection))
                      `(:vectors (:size ,(vecdb-collection-vector-size 
collection)
                                        :distance "Cosine"))
@@ -75,13 +74,13 @@ properties of the collection."
 
 (cl-defmethod vecdb-delete ((provider vecdb-qdrant-provider)
                             (collection vecdb-collection))
-  "Delete a collection from the qdrant database."
+  "Delete a COLLECTION of embeddings in PROVIDER.  This should remove all 
data."
   (vecdb-qdrant-call provider 'delete (concat "/collections/" 
(vecdb-collection-name collection))
                      nil t))
 
 (cl-defmethod vecdb-exists ((provider vecdb-qdrant-provider)
                             (collection vecdb-collection))
-  "Check if a collection exists in the qdrant database."
+  "Check if a COLLECTION exists in PROVIDER, return non-nil if it does."
   (let ((response (vecdb-qdrant-call provider 'get (concat "/collections/" 
(vecdb-collection-name collection)
                                                            "/exists") nil t)))
     (not (eq :false (plist-get (plist-get response :result) :exists)))))
@@ -89,7 +88,7 @@ properties of the collection."
 (cl-defmethod vecdb-upsert-items ((provider vecdb-qdrant-provider)
                                   (collection vecdb-collection)
                                   items &optional sync)
-  "Insert items into a collection in the qdrant database."
+  "Upsert a list of `vecdb-item' objects into the COLLECTION with PROVIDER."
   (vecdb-qdrant-call provider 'put
                      (concat "/collections/" (vecdb-collection-name 
collection) "/points?wait="
                              (if sync "true" "false"))
@@ -99,15 +98,14 @@ properties of the collection."
                                                   `(:id ,(vecdb-item-id item)
                                                         :vector 
,(vecdb-item-vector item))
                                                   (when (vecdb-item-payload 
item)
-                                                    `(:payload 
,(vecdb-item-payload item))))
-                                                 )
+                                                    `(:payload 
,(vecdb-item-payload item)))))
                                                items)))
                      t))
 
 (cl-defmethod vecdb-get-item ((provider vecdb-qdrant-provider)
                               (collection vecdb-collection)
                               id)
-  "Retrieve an item from a collection in the qdrant database by ID."
+  "Get items with ID from the COLLECTION with PROVIDER."
   (let ((result (vecdb-qdrant-call provider 'get
                                    (concat "/collections/" 
(vecdb-collection-name collection) "/points/" id))))
     (when result
@@ -120,7 +118,7 @@ properties of the collection."
 (cl-defmethod vecdb-delete-items ((provider vecdb-qdrant-provider)
                                   (collection vecdb-collection)
                                   ids &optional sync)
-  "Delete items from a collection in the qdrant database."
+  "Delete items with IDs from the COLLECTION with PROVIDER."
   (vecdb-qdrant-call provider 'post
                      (concat "/collections/" (vecdb-collection-name 
collection) "/points/delete?wait="
                              (if sync "true" "false"))
@@ -131,7 +129,7 @@ properties of the collection."
 (cl-defmethod vecdb-search-by-vector ((provider vecdb-qdrant-provider)
                                       (collection vecdb-collection)
                                       vector &optional limit)
-  "Search for items in a collection in the qdrant database."
+  "Search for items in the COLLECTION with PROVIDER that are similar to 
VECTOR."
   (let ((result (vecdb-qdrant-call provider 'post
                                    (concat "/collections/" 
(vecdb-collection-name collection) "/points/query")
                                    `(:query (:nearest ,vector)
diff --git a/vecdb.el b/vecdb.el
index c501ea3dba..6c94bb7d63 100644
--- a/vecdb.el
+++ b/vecdb.el
@@ -4,7 +4,7 @@
 
 ;; Author: Andrew Hyatt <ahy...@gmail.com>
 ;; Homepage: https://github.com/ahyatt/vecdb
-;; Package-Requires: ((emacs "28.1") (plz "0.8"))
+;; Package-Requires: ((emacs "29.1") (plz "0.8"))
 ;; Package-Version: 0.1
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -25,10 +25,10 @@
 ;; This package provides an interface to embedding databases, allowing
 ;; applications to store data and retrieve it via similarity search.
 
-;;; Code
-
 (require 'cl-lib)
 
+;;; Code:
+
 (cl-defstruct vecdb-provider
   "A structure representing an embedding database provider."
   name)
@@ -51,19 +51,19 @@ An ID may be an integer or a string, and is used to 
uniquely identify the item."
   id vector payload)
 
 (cl-defgeneric vecdb-create (provider collection)
-  "Create a new collection of embeddings."
+  "Create a new COLLECTION of embeddings for PROVIDER."
   (ignore collection)
   (signal 'not-implemented
           (list "vecdb-create not implemented for" (vecdb-provider-name 
provider))))
 
 (cl-defgeneric vecdb-delete (provider collection)
-  "Delete a collection of embeddings. This should remove all data."
+  "Delete a COLLECTION of embeddings in PROVIDER.  This should remove all 
data."
   (ignore collection)
   (signal 'not-implemented
           (list "vecdb-delete not implemented for" (vecdb-provider-name 
provider))))
 
 (cl-defgeneric vecdb-exists (provider collection)
-  "Check if a collection exists, return non-nil if it does."
+  "Check if a COLLECTION exists in PROVIDER, return non-nil if it does."
   (ignore collection)
   (signal 'not-implemented
           (list "vecdb-exists not implemented for" (vecdb-provider-name 
provider))))
@@ -95,4 +95,4 @@ An ID may be an integer or a string, and is used to uniquely 
identify the item."
 
 (provide 'vecdb)
 
-;; vecdb.el ends here
+;;; vecdb.el ends here

Reply via email to