branch: externals/ellama
commit f9e0de5af6a48659dc39914e61964231fe75ca69
Merge: 316e982ef6 327c488e9b
Author: Sergey Kostyaev <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #3 from jiahut/main
:recycle: Refactor ellama.el code for improved response handling.
---
ellama.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ellama.el b/ellama.el
index 767a870dd4..0378092777 100644
--- a/ellama.el
+++ b/ellama.el
@@ -116,6 +116,7 @@ Filter PROC output STRING."
(setq ellama--extract nil)
(setq ellama--extraction-state 'before))
(when-let ((response (plist-get data :response)))
+ (goto-char (process-mark proc))
(if ellama--extract
(progn
(setq ellama--line (concat ellama--line
response))
@@ -130,7 +131,8 @@ Filter PROC output STRING."
(insert ellama--line)))
(_ nil))
(setq ellama--line nil)))
- (insert response)))))
+ (insert response)
+ (set-marker (process-mark proc) (point))))))
(split-string string "\n" t))
(setq ellama--unprocessed-data nil)
(set-marker (process-mark proc) (point))
@@ -224,7 +226,7 @@ default. Default value is `ellama-template'."
:name "ellama"
:command (list
ellama-curl-executable
- "-X" "POST" ellama-url "-d"
+ "-s" "-X" "POST" ellama-url "-d"
(json-encode-plist ellama--request))
:filter 'ellama--filter
:sentinel sentinel)