s-kostyaev / ellama

Ellama is a tool for interacting with large language models from Emacs.
GNU General Public License v3.0
359 stars 25 forks source link

WIP: Use org-mode by default for chat. Experimental #52

Closed s-kostyaev closed 5 months ago

s-kostyaev commented 5 months ago

Try to use org-mode for chat. Experimental

s-kostyaev commented 5 months ago

Not working for code blocks. System prompt doesn't help. Models generates code blocks im markdown syntax.

s-kostyaev commented 5 months ago

@ahyatt Am I doing something wrong with system message?

s-kostyaev commented 5 months ago

@ahyatt I create interactions with system message, append user message to it and send it to ollama as single request. Should this work?

s-kostyaev commented 5 months ago

TODO:

s-kostyaev commented 5 months ago

Elisp translation works. There is another issue. Fill region is terrible with org-mode code blocks. Disable lines truncation by default in org-mode and enable word wrapping as advice for users?

ahyatt commented 5 months ago

@ahyatt I create interactions with system message, append user message to it and send it to ollama as single request. Should this work?

It should work. Are you doing this with ollama? What it does with ollama is to send the system message in the "system" param in the request. If you don't find this effective, you could try adding it to the user message instead. What I try to do with these kinds of problems is see if things work with Open AI or Gemini, which are in my experience better at instruction following than local models are.

You may also want to double-check what is actually being sent. What I usually do is (setq url-debug t) and then you can check the url debug buffer (I don't remember the name at the moment), searching for the outgoing JSON to verify the request looks correct.