Skip to content
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 support #8

Closed
minad opened this issue Mar 10, 2023 · 4 comments
Closed

Org support #8

minad opened this issue Mar 10, 2023 · 4 comments

Comments

@minad
Copy link
Contributor

minad commented Mar 10, 2023

I saw that you consider adding this. What are the obstacles? Could you use some generic regexp-based machinery to support different file types? Maybe you also need some converter for the responses, which I suspect are in markdown?

@karthink
Copy link
Owner

karthink commented Mar 10, 2023

@minad Hi!

I'm almost done with org support, I should be adding it in 30 minutes or so.

For the last couple of days I was trying to get ChatGPT to reply with org-formatted responses by using a prompt, but the results were inconsistent and non-reproducible. I guess this element of randomness is expected with LLMs.

So I wrote a basic converter for the responses instead. (Suggested markdown -> org solutions all seemed to involve pandoc, so I wrote a very basic parser in elisp.)


BTW the readme doesn't mention this yet, but you can use gptel in any buffer by selecting a region and calling gptel-send, the special buffer is not needed. You can then select a region that includes your prompt and its response and call gptel-send again to continue the conversation. (Responses are tracked using a text property.)

@minad minad mentioned this issue Mar 10, 2023
@karthink
Copy link
Owner

karthink commented Mar 10, 2023

Org support added in 9db679d.

You can enable it with

(setq gptel-default-mode 'org-mode
      gptel-prompt-string "*** ") ;<-- or anything you'd like

Alternatively, you can directly call gptel-send from an org-mode buffer (with a region of text selected) and it should work correctly.

@minad
Copy link
Contributor Author

minad commented Mar 10, 2023

Great, I will try this now!

@minad minad closed this as completed Mar 10, 2023
@hab25
Copy link

hab25 commented Mar 18, 2024

@karthink

(Suggested markdown -> org solutions all seemed to involve pandoc, so I wrote a very basic parser in elisp.)

Why avoid pandoc? IMO reuse of a much more complete and robust implementation seems like too enormous of a benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants