feat: implement multiple named conversations
- Replace single conversation file with a conversations directory structure
- Add support for named conversations via -n/--name flag
- Implement conversation name validation
- Add test coverage for conversation management
So, this is my attempt! Critique welcome :)
Thank you, I agree the API feels odd - I think what you're suggesting would be an improvement.
After using smartcat for a bit, I had the same thought as @bytesoverflow - that being able to have multiple
conversations going would be hugely beneficial (that's the paradigm I use for ChatGPT and really enjoy it).
I tried modifying the existing -e, --extend-conversation (as I thought that was the easist way to enable this
feature), but I determined that without changing some other assumptions, that approach wouldn't work - here's why:
sc "Say Hello" # write to unnamed conversation
sc "Print wave emoji" # over-write unnamed conversation
sc -e "Again" # ?????
sc -e "emoji" "add a shrug" # Copy unnamed conversation to 'emoji', then add to it
The problem is that intent of line 3 is difficult to determine:
- "Again" could be the desired "name" of the conversation, and we want to use the
defaulttemplate with no input - "Again" could be the "input" and we want to use the
unnamedconversation anddefaulttemplate - "Again" could be the
templateand we want to use theunnamedconversation and no input
smartcat already handles the third use case by checking if Again is a known template, but differentiating the first
two is problematic.
I would REALLY love to see this feature added, and I think that a secondary param of -n --name "name" would be the
safest way to add it.
EDIT: I just tried out the MR, and it would be nice if this worked:
sc "Say Hello" # over-write unnamed converation
sc -e "Now add a wave" # Add to unnamed conversation
sc -e -n greeting "Add a shrug" # Copy unnamed conversation to 'greeting', then add to it
But right now I get an error saying the conversation hasn't started yet.