Skip to content

Commit 7672ab9

Browse files
committed
Insert newlines after streaming tool results
1 parent 5fad6f1 commit 7672ab9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gptel-curl.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ Optional RAW disables text properties and transformation."
274274
(set-marker-insertion-type tracking-marker t)
275275
(plist-put info :tracking-marker tracking-marker))
276276
(goto-char tracking-marker)
277+
(when (plist-get info :last-was-tool-result)
278+
(insert gptel-response-separator)
279+
(plist-put info :last-was-tool-result nil))
277280
(unless raw
278281
(when transformer
279282
(setq response (funcall transformer response)))
@@ -288,7 +291,8 @@ Optional RAW disables text properties and transformation."
288291
(`(tool-call . ,tool-calls)
289292
(gptel--display-tool-calls tool-calls info))
290293
(`(tool-result . ,tool-results)
291-
(gptel--display-tool-results tool-results info))))
294+
(gptel--display-tool-results tool-results info)
295+
(plist-put info :last-was-tool-result t))))
292296

293297
(defun gptel-curl--stream-filter (process output)
294298
(let* ((fsm (alist-get process gptel--request-alist))

0 commit comments

Comments
 (0)