Skip to content

Commit d6b4335

Browse files
committed
Insert newlines after streaming tool results
1 parent 55355bd commit d6b4335

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
@@ -264,6 +264,9 @@ Optional RAW disables text properties and transformation."
264264
(set-marker-insertion-type tracking-marker t)
265265
(plist-put info :tracking-marker tracking-marker))
266266
(goto-char tracking-marker)
267+
(when (plist-get info :last-was-tool-result)
268+
(insert gptel-response-separator)
269+
(plist-put info :last-was-tool-result nil))
267270
(unless raw
268271
(when transformer
269272
(setq response (funcall transformer response)))
@@ -278,7 +281,8 @@ Optional RAW disables text properties and transformation."
278281
(`(tool-call . ,tool-calls)
279282
(gptel--display-tool-calls tool-calls info))
280283
(`(tool-result . ,tool-results)
281-
(gptel--display-tool-results tool-results info))))
284+
(gptel--display-tool-results tool-results info)
285+
(plist-put info :last-was-tool-result t))))
282286

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

0 commit comments

Comments
 (0)