This is incredibly basic, adding onto the example code.
Features:
- Edit last response in $EDITOR.
- Undo last prompt-response exchange.
- Response regeneration.
- Pseudo multi-line prompts (using Python
join). - Dreadfully primitive save/load.
Argument -m lets you pick an ollama model.
Use ollama list to see available models. Say you want to use mistral-small.
Then enter python3 ollama-chat-with-edit2.py -m mistral-small.
Change DEFAULT_MODEL in the code to pick a default.
And the saving is dreadfully primitive.
/save will create a file called save.json in the working directory, and will overwrite any previously existing file of the same name, so look out!