diff options
Diffstat (limited to 'archive/gptel')
| -rw-r--r-- | archive/gptel/custom/gptel-prompts.el | 54 | ||||
| -rw-r--r-- | archive/gptel/gptel-tools/read_text_file.el | 4 | ||||
| -rw-r--r-- | archive/gptel/tests/testutil-filesystem.el | 7 |
3 files changed, 9 insertions, 56 deletions
diff --git a/archive/gptel/custom/gptel-prompts.el b/archive/gptel/custom/gptel-prompts.el index a2b266f27..28197ceba 100644 --- a/archive/gptel/custom/gptel-prompts.el +++ b/archive/gptel/custom/gptel-prompts.el @@ -29,58 +29,12 @@ ;; Boston, MA 02111-1307, USA. ;;; Commentary: - -;; This package provides enhanced prompt management capabilities for GPTel, -;; allowing you to organize and dynamically load AI prompts from external -;; files rather than hardcoding them in your Emacs configuration. - -;; Key Features: -;; -;; * Multi-format prompt support: Load prompts from .txt, .md, .org, .json, -;; .eld (Emacs Lisp data), .el (Emacs Lisp functions), and .poet/.jinja -;; (Prompt Poet/Jinja2 templates) -;; -;; * Template interpolation: Use Jinja2-style {{variable}} syntax with -;; customizable variables and dynamic functions -;; -;; * File watching: Automatically reload prompts when files change -;; -;; * Project-aware prompts: Automatically load project-specific conventions -;; from CONVENTIONS.md or CLAUDE.md files ;; -;; * Conversation format support: Handle multi-turn conversations with -;; system/user/assistant roles - -;; Setup: -;; -;; (use-package gptel-prompts -;; :after (gptel) -;; :custom -;; (gptel-prompts-directory "~/my-prompts") -;; :config -;; (gptel-prompts-update) -;; ;; Optional: auto-reload on file changes -;; (gptel-prompts-add-update-watchers)) - -;; File Formats: -;; -;; * Plain text (.txt, .md, .org): Used as-is for system prompts -;; * JSON (.json): Array of {role: "system/user/assistant", content: "..."} -;; * Emacs Lisp data (.eld): List format for conversations -;; * Emacs Lisp code (.el): Lambda functions for dynamic prompts -;; * Prompt Poet (.poet, .j2, .jinja, .jinja2): YAML + Jinja2 templates - -;; Template Variables: -;; -;; Use {{variable_name}} in your prompts. Variables can be defined in -;; `gptel-prompts-template-variables' or generated dynamically by functions -;; in `gptel-prompts-template-functions'. - -;; Project Integration: +;; Adds file-backed GPTel directives. Prompt files can be plain text, structured +;; conversations, Elisp data/functions, or Prompt Poet/Jinja templates. ;; -;; Add `gptel-prompts-project-conventions' to `gptel-directives' to -;; automatically load project-specific prompts from CONVENTIONS.md or -;; CLAUDE.md files in your project root. +;; The library can reload prompt files, interpolate configured template +;; variables, and expose project-convention prompts from project roots. ;;; Code: diff --git a/archive/gptel/gptel-tools/read_text_file.el b/archive/gptel/gptel-tools/read_text_file.el index f35c94941..06a01db12 100644 --- a/archive/gptel/gptel-tools/read_text_file.el +++ b/archive/gptel/gptel-tools/read_text_file.el @@ -19,6 +19,10 @@ ;; GNU General Public License for more details. ;;; Commentary: +;; +;; GPTel tool for safely reading text files under the user's home directory. +;; It validates the resolved path, rejects directories and unreadable files, +;; guards large files, and returns metadata alongside content. ;;; Code: diff --git a/archive/gptel/tests/testutil-filesystem.el b/archive/gptel/tests/testutil-filesystem.el index b1970b62d..283a3b2b0 100644 --- a/archive/gptel/tests/testutil-filesystem.el +++ b/archive/gptel/tests/testutil-filesystem.el @@ -1,4 +1,4 @@ -;;; testutil-filesystem.el --- -*- coding: utf-8; lexical-binding: t; -*- +;;; testutil-filesystem.el --- Filesystem helpers for archived GPTel tests -*- coding: utf-8; lexical-binding: t; -*- ;; ;; Author: Craig Jennings <c@cjennings.net> ;; @@ -27,11 +27,8 @@ By default, hidden entries (starting with '.') are excluded unless INCLUDE-HIDDEN is non-nil. FILTER-PREDICATE, if non-nil, is a predicate function called on each entry's absolute path; only entries where it returns non-nil are included." - ;; Convert 'path' to an absolute filename string (let* ((expanded-path (expand-file-name path)) - ;; get absolute paths in expanded directory (entries (directory-files expanded-path t nil t)) - ;; remove "." ".." entries (filtered-entries (cl-remove-if (lambda (entry) @@ -40,10 +37,8 @@ non-nil are included." (and (not include-hidden) (string-prefix-p "." (f-filename entry))))) entries))) - ;; apply filtered predicate if provided (if filter-predicate (seq-filter filter-predicate filtered-entries) - ;; retun filtered-entries filtered-entries))) (defun cj/get-file-info (path) |
