[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel b31c9be5e0 238/273: gptel-ollama: Adjust Ollama stre
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel b31c9be5e0 238/273: gptel-ollama: Adjust Ollama stream parser for libjansson |
Date: |
Wed, 1 May 2024 10:02:40 -0400 (EDT) |
branch: elpa/gptel
commit b31c9be5e01785212c79170bf93de8f9d3d273f1
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel-ollama: Adjust Ollama stream parser for libjansson
* gptel-ollama.el (gptel-curl--parse-stream): libjansson and
json.el behave differently w.r.t moving point when there is a
parsing error. Fix by explicitly handling point when there is an
error. (#255)
---
gptel-ollama.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gptel-ollama.el b/gptel-ollama.el
index 5622136a3c..00b40c9b0e 100644
--- a/gptel-ollama.el
+++ b/gptel-ollama.el
@@ -45,10 +45,10 @@ Ollama models.")
(when (bobp)
(re-search-forward "^{")
(forward-line 0))
- (let* ((content-strs)
- (content))
+ (let* ((content-strs) (content) (pt (point)))
(condition-case nil
(while (setq content (gptel--json-read))
+ (setq pt (point))
(let ((done (map-elt content :done))
(response (map-elt content :response)))
(push response content-strs)
@@ -56,7 +56,7 @@ Ollama models.")
(with-current-buffer (plist-get info :buffer)
(setq gptel--ollama-context (map-elt content :context)))
(goto-char (point-max)))))
- (error (forward-line 0)))
+ (error (goto-char pt)))
(apply #'concat (nreverse content-strs))))
(cl-defmethod gptel--parse-response ((_backend gptel-ollama) response info)
- [nongnu] elpa/gptel e79e386964 191/273: README: Move gptel-request to FAQ, (continued)
- [nongnu] elpa/gptel e79e386964 191/273: README: Move gptel-request to FAQ, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a61fda4661 197/273: gptel-transient: better multi-line directive editing, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 226f8f0d90 208/273: gptel: Add customizable display-action (#216), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 8ba07d042c 210/273: gptel: Bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a32f4effe5 215/273: gptel-curl: Handle empty responses correctly, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel e5f54d1d09 229/273: gptel-anthropic: Modify order of request items, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f529457bbe 232/273: gptel: Use visual-line-mode when ediff-ing, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9eea4be5ed 245/273: gptel-transient: Fix gptel-menu definition bug (#265), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 6d3e4a99f5 236/273: gptel-transient: Rename additional-directive functions, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5d069cfca8 243/273: gptel-anthropic: Simplify stream parser, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel b31c9be5e0 238/273: gptel-ollama: Adjust Ollama stream parser for libjansson,
ELPA Syncer <=
- [nongnu] elpa/gptel 73a0cc25ba 237/273: gptel-transient: Simplify model selection, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 12e00cbd09 247/273: gptel-transient: No pre-fill when reading from minibuffer, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5dcbf40066 241/273: gptel: Make model parameters global, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 567af4d2ee 258/273: gptel-org: Read config from Org properties (#141), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 66a63e6c82 266/273: gptel-ollama: switch to chat API, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a2b16c43b1 268/273: gptel-org: Include org-element-lineage-map with gptel (#294), ELPA Syncer, 2024/05/01