Closed akhil3417 closed 5 months ago
renamed the org file to .md since github doesn't support it bug.md
#+begin\_src assembly
Is this with or without streaming responses?
Is this with or without streaming responses?
with streaming responses , also the first source block is always correct.
I was able to reproduce this with the mistralai/Mixtral-8x7B-Instruct-v0.1
model (and only that model). Unfortunately this is a quirk of the LLM and not something I can fix comprehensively.
When it's sent the previous response (in Org-mode), it switches to trying to use Org mode, and does a terrible job of it. The \_
in #+begin\_src
(and elsewhere) is returned exactly like this from the model.
I can think of two semi-solutions:
(defun my/gptel-fix-mistral-org-response (beg end)
"Fix org responses from LLM"
(when (and (equal gptel-model "mistralai/Mixtral-8x7B-Instruct-v0.1")
(derived-mode-p 'org-mode))
(save-excursion
(goto-char beg)
(while (search-forward "\\_" end t)
(replace-match "_")))
(font-lock-ensure beg end)))
(add-hook 'gptel-post-response-functions #'my/gptel-fix-mistral-org-response)
Modify as appropriate.
another day of LLMs trying to do things other than what is asked (see ss below)
also thanks for the awesome package , gptel works seamlessly in eMacs-android as well.
Screenshot:
renamed the org file to .md since github doesn't support it potential_bug.md
#+begin\_src assembly
related to 10f5760