-
Notifications
You must be signed in to change notification settings - Fork 151
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
Org mode response formatting #296
Comments
@wlauppe gptel converts markdown to Org on the fly, I've been slowly plugging away at improving this. Headings are explicitly not handled yet, so this error is expected:
I thought I had the strong/bold text handled correctly though, so you shouldn't be seeing You can search the issues page for markdown to org conversion, there have been a few threads about it in the past (such as #81). Some people are using pandoc to convert the response instead, but this requires streaming to be turned off. You can also help me fix it by generating test data I can use. Here's how to go about it:
|
Hello Karthik, thanks for your quick reply. Here is the gptel-log and the response with gptel-log-level set to info. I have installed your latest GPTel version (commit: a2b16c4). Let me know if I can help in any other way. gptel-log
response
|
* test/gptel-org-test.el (gptel-org--test-stream-conversion): Add a test harness to make comparing markdown to org easy. * gptel-org.el (gptel--stream-convert-markdown->org): Handle headings and strong chars in the converter. Addresses #296.
@wlauppe Thanks for the test data, I plugged away at the converter some more. Please update and test. |
Forgot to mention: The improvements are on the Org formatting of streaming responses only. Non-streaming responses are still wonky, but that's very easy to fix, I'll get to it later. |
Great! Output looks good now, here is the test data. Thanks a lot! gptel-log
response
|
* test/gptel-org-test.el (gptel-org--test-compare-org): Add a helper function to view the markdown input and org output interactively. * gptel-org.el (gptel--stream-convert-markdown->org): Handle single asterisks at the end of messages. Addresses #296.
Okay, I fixed this edge case too. Could you get the LLM to generate a source block with what looks like a markdown heading (
The |
Hello Karthik, yes, it seems to be working: commit version 97ab6cb, produces the following: Give me a bash script, that counts from 1 to 10:
response
|
Hi Karthik, thanks for GPTel, it's really a great tool!
When I use gptel-send in an Org mode file, the response is only partially in Org mode format. There are still some Markdown elements left.
First, I thought this must have something to do with my Emacs config, but with vanilla Emacs in a fresh Ubuntu VM and just GPTel set up according to your readme, I experience the same problems. For clarity i added an example output. If i mark the sentence
What are the advantages of org-mode? Give a detailed overview
and send it to gptelOpenRouter:google/gemini-pro
I get the output below.Can you reproduce this? Do you know why this happens and how to fix it?
The text was updated successfully, but these errors were encountered: