pfrankov / obsidian-local-gpt

Local Ollama and OpenAI-like GPT's assistance for maximum privacy and offline access
MIT License
265 stars 18 forks source link

New features #14

Closed quantarion closed 3 months ago

quantarion commented 3 months ago

Are you still working on this plugin, and are you interested in adding new features? If I wasn't old and grampy, I'd learn typescript and do it myself, but as it is all I can do is to explain what I think would be great features to add with minimal effort.

pfrankov commented 3 months ago

Hi! I think that the plugin has all the main features already and there is no need to make it more complex. Almost every additional feature requires additional settings which make plugin more complicated in every possible way: it's hard to test, it's hard to maintain, it's hard to work as a user. But that doesn't mean I'm not interested in feature suggestions at all. I am open to any suggestions.

quantarion commented 3 months ago

For the context menu, it would be easier to invoke actions without using keyboard, after making a selection with the mouse.

Other thing that might be interesting (for me at least) is to integrate chat into the notes directly, not as a side dialog. I'd do it this way using block quotes:

If the user writes '''system act as a physics professor '''

'''user What is energy? '''

You should send this to LLM (if no system is found, then the system prompts is used)

"role" : "system", "message" : "act as a physics professor" "role" : "user", "message" : "What is energy?" which should output '''assistant Energy is capacity to do work. ''' Now I could continue writing

This is interesting definition, I wonder what work is?.

'''user But what is work? '''

Now my comment above is ignored except for the "user" part. The context that should be sent to LLM becomes:

"role" : "system", "message" : "act as a physics professor" "role" : "user", "message" : "What is energy." "role" : "assistant", "message" : "Energy is capacity to do work." "role" : "user", "message" : "But what is work?"

to which the LLM answers

'''assistant Work is transfer of energy. ''' God, I hate physics!

And so on. You can now have chat throughout the note and as a bonus you can easily separate chat from the rest later on if needed.

quantarion commented 3 months ago

In case you care, here's main.ts with action items moved to the right-click context menu. Feel free to ignore it, its your plugin after all. r-c-c-m.patch