]> Humopery - gptelconfig.git/commitdiff
apply_patch need not append the new line
authorErik Mackdanz <erikmack@gmail.com>
Fri, 14 Nov 2025 03:55:12 +0000 (21:55 -0600)
committerErik Mackdanz <erikmack@gmail.com>
Fri, 14 Nov 2025 03:55:12 +0000 (21:55 -0600)
Parameter doc generalization

gptel

diff --git a/gptel b/gptel
index b031cbd18ded10a938effd7102b6fdb1f0ae6cba..4bb1aea78da6457a4c4ebb67386e55c504bed98b 100644 (file)
--- a/gptel
+++ b/gptel
             )
  )
 
-(gptel-make-tool
- :name "current_directory"
- :function (lambda ()
-            (pwd)
-            )
- :category "filesystem"
- :confirm nil
- :description "Returns the current working directory."
- :args nil)
-
 (gptel-make-tool
  :name "replace_file"
  :function (lambda (workingdirectory path content)
  :function (lambda (workingdirectory patch)
             (cd workingdirectory)
             (let ((output-buffer (generate-new-buffer "*patch-output*")))
-               (call-process-region (concat patch "\n") nil "patch" nil output-buffer t "-p1" "--fuzz" "3")
+               (call-process-region patch nil "patch" nil output-buffer t "-p1" "--fuzz" "3")
               (message "Patch output: %s" (with-current-buffer output-buffer (buffer-string)))
               (with-current-buffer output-buffer (buffer-string))
               )
             )
- :description "Patch files in the working directory. If the patch fails to apply, generate a new patch and try again."
+ :description "Patch files in the working directory. A patch should only have one hunk; if multiple hunks are required, generate multiple patches. If the patch fails to apply, generate a new patch and try again."
  :args (list '(:name "workingdirectory"
                     :type string
                     :description "The project's directory to change to before running the command. Defaults to '.'"
   :description "A preset for hledger tasks"
   :backend "DeepSeek"
   :model 'deepseek-chat
-  :system "You add valid account data to hledger accounting files by applying a patch. The working diretory is /home/erik/src/ledgerfile and you may only list files under that directory. The main ledgerfile is /home/erik/src/ledgerfile/2025only. You may read only the ledgerfile or files included by the ledgerfile. You may write only to the month file (like 202510 or 202512). A credit card purchase is added by adding the transaction as a credit (usually to Expenses:Dining/Entertainment) and a corresponding (blank) debit to Liabilities:Chase; also the same amount is credited to the following 'Chase balance' transaction (which may be in next month's ledgerfile). Remember to actually patch the file. A patch should only have one hunk; if multiple hunks are required, generate multiple patches. After adding a transaction, check that the ledger is balanced and fix any errors."
+  :system "You add valid account data to hledger accounting files by applying a patch. The working diretory is /home/erik/src/ledgerfile and you may only list files under that directory. The main ledgerfile is /home/erik/src/ledgerfile/2025only. You may read only the ledgerfile or files included by the ledgerfile. You may write only to the month file (like 202510 or 202512). A credit card purchase is added by adding the transaction as a credit (usually to Expenses:Dining/Entertainment) and a corresponding (blank) debit to Liabilities:Chase; also the same amount is credited to the following 'Chase balance' transaction (which may be in next month's ledgerfile). Remember to actually patch the file.  After adding a transaction, check that the ledger is balanced and fix any errors."
   :confirm-tool-calls 'auto
   :temperature 0.0
   :tools '(