-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong language in the source block header #303
Comments
The LLM is sending this string: ```javascript
some code
``` So gptel shows If you anticipate this problem, you can use gptel's post-response hook to replace it afterwards. Untested: (defun gptel-fix-src-header (beg end)
(save-excursion
(goto-char beg)
(while (re-search-forward "^#\\+begin_src javascript" end t)
(replace-match "#+begin_src js"))))
(add-hook 'gptel-post-response-functions #'gptel-fix-src-header) |
It works, but since javascript is not a valid babel language (as opposed to js), perhaps the problem should be addressed internally, WDYT? |
I need to make the markdown -> org pipeline user-customizable first. Then gptel can provide some utility functions for mini-fixes like this without having to resort to the post-response hook, which is a bit of a bludgeon. This is a low priority for now. Do you know where I can find the list of babel names for languages? |
Should be all the ob-*.el files in https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp |
Gptel returns
#+begin_src javascript
when it should be#+begin_src js
. Any suggestion on how to fix this?The text was updated successfully, but these errors were encountered: