(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