s-kostyaev / ellama

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

How to (re)create new session (a.k.a how manage sessions) ? #86

Open liar666 opened 4 months ago

liar666 commented 4 months ago

Hi,

When using ellama, I often get errors like:

I'm probably using ellama's sessions incorrectly, but I was not able to find any documentation about what they are and how to use them, so I'm asking for help here. Sorry if it's the wrong place.

In particular, I'm looking at how to (re)create a session once it has been deleted and/or how to recover (protect against killing) a session.

Here is what I do:

1. Open (Doom)Emacs
2. Go to *(doom:)scratch* buffer
3. Write a question (e.g. "What is climate change?")
4. Select the text
5. Call ellama-ask-selection
6. (mistakenly - or not) Kill ellama's buffer (C-x k)   <- I assume error comes from one ...
7. (mistakenly - or not) Close/Kill Emacs                   <- ... of these 2 lines
8. Select the question again
9. Call ellama-ask-selection again

FYI, I'm using Emacs in client/server mode, so most of the time I just close the windows, but sometimes I need to actually kill it and restart it. <--- might it be the 3rd reason why I get the errors?

Thank in advance for any help.

s-kostyaev commented 4 months ago

Hi @liar666

Try M-x ellama-load-session command. It's exactly what you want.