)
)
-(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 '(