simonw / llm

Access large language models from the command-line
https://llm.datasette.io
Apache License 2.0
4.36k stars 240 forks source link

[FR] Resume partial conversations #372

Open ethanj801 opened 10 months ago

ethanj801 commented 10 months ago

I often find myself wanting to modify some recent prompt while maintaining most of the previous conversation. (e.g. I have asked for a list of 10 ideas, then I ask for an elaboration on one of the ideas and decide that it is not to my liking and want to ask about the other idea without keeping the other response in context). One way this maybe could be implemented would be to add an additional two properties to the logged LLM chats. The first would just be an additional conversation specific id key (since currently all conversations have the same key) and the second would be a backwards link to the previous completions/prompts. That way you could resume a chat from any arbitrary points just by calling llm -c -cid xxxxxxx -qid xxxxxx.

jvmncs commented 7 months ago

I'd also love a feature like this. I was thinking a smaller/more incremental change for this could be to add the ability to fork conversations into new ones with a fresh cid. This implementation would be slightly more limited, since you have to know ahead of time when you want to fork, but it might help in that it's more of an incremental change and fully compatible with existing DBs.