Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions llm-tool-collection.el
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ the tool is defined, it is additionally made available via
`llm-tool-collection-get-all' and `llm-tool-collection-get-category',
and all functions in `llm-tool-collection-post-define-functions' are
called with the tool's spec as their argument."
(declare (indent defun)
(declare (indent 4)
(doc-string 4)
(debug (&define symbolp sexp sexp stringp def-body)))
(let* ((optional nil)
(arg-syms '())
(arg-specs '()))
(when (plist-get specs :async) (push 'callback-fn arg-syms))
(dolist (arg args)
(if (eq arg '&optional)
(progn
Expand Down Expand Up @@ -206,26 +208,13 @@ similar will add all tools to the respective client:
(mapcar #'symbol-value llm-tool-collection--all-tools))

;;; Imenu

;;;###autoload
(cl-pushnew (list "LLM Tools"
(concat "^\\s-*("
(regexp-opt '("llm-tool-collection-deftool") t)
"\\s-+\\(" lisp-mode-symbol-regexp "\\)")
2)
lisp-imenu-generic-expression :test #'equal)

;;; Font-Lock

;;;###autoload
(defconst llm-tool-collection-font-lock-keywords
'(("(\\(llm-tool-collection-deftool\\)\\_>[ \t'(]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
(1 'font-lock-keyword-face)
(2 'font-lock-function-name-face nil t))))

;;;###autoload
(font-lock-add-keywords 'emacs-lisp-mode llm-tool-collection-font-lock-keywords)

;;; Tools

(llm-tool-collection-deftool read-file
Expand Down