From: Erik Mackdanz Date: Sun, 14 Dec 2025 19:48:37 +0000 (-0600) Subject: db_get_schema tool, convert to async and use temp buffer X-Git-Url: https://git.humopery.space/?a=commitdiff_plain;h=0224d0169fc74e307c28d1b9198ba39111439c33;p=gptelconfig.git db_get_schema tool, convert to async and use temp buffer --- diff --git a/gptel b/gptel index ff168a9..7bdaf23 100644 --- a/gptel +++ b/gptel @@ -350,13 +350,17 @@ (gptel-make-tool :name "db_get_schema" - :function (lambda () + :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 (buffer-string)) + (with-current-buffer output-buffer + (funcall callback (buffer-string)) + ) + (kill-buffer output-buffer) )) :description "Dump the schema of the sample PostgreSQL database" + :async t :confirm nil :args nil :include t