]> Humopery - gptelconfig.git/commitdiff
db_get_schema, simplify main
authorErik Mackdanz <erikmack@gmail.com>
Sun, 14 Dec 2025 20:11:08 +0000 (14:11 -0600)
committerErik Mackdanz <erikmack@gmail.com>
Sun, 14 Dec 2025 20:11:08 +0000 (14:11 -0600)
gptel

diff --git a/gptel b/gptel
index 7bdaf238fea5fed07927130bbf0f292cd9d8fff9..83dbe5f75c5b67f40d4cbdb5cfa0e4d238716bc4 100644 (file)
--- a/gptel
+++ b/gptel
 (gptel-make-tool
  :name "db_get_schema"
  :function (lambda (callback)
-            (let ((output-buffer (generate-new-buffer "*query-output*")))
-               (call-process-region "" nil "pg_dump" nil output-buffer t "--schema-only" "llm")
-              ;; (message "Get schema output: %s" (with-current-buffer output-buffer (buffer-string)))
-              (with-current-buffer output-buffer
-                (funcall callback (buffer-string))
-                )
-              (kill-buffer output-buffer)
+            (with-temp-buffer
+               (call-process-region "" nil "pg_dump" nil t t "--schema-only" "llm")
+              (funcall callback (buffer-string))
               ))
  :description "Dump the schema of the sample PostgreSQL database"
  :async t