omagdy7 / ollama-logseq

Logseq plugin to integerate with ollama
MIT License
167 stars 15 forks source link

feat: Add custom prompt defined in configuration to apply on block #16

Closed gixita closed 4 months ago

gixita commented 4 months ago

This commit introduces the capability for users to apply custom prompts defined in the configuration to a block. Key changes include:

Sorry I should have open an issue to discuss the feature, I will understand if you refuse it, if so let me know what I should do.

The goal of the PR is to allow the user to define a custom prompt that he uses frequently. In my use case, I often request ollama to reformulate a block to improve clarity and conciseness (not being a english native). By having the prompt defined in configuration and triggered by the menu, it allows to be more convenient and quicker to use.

omagdy7 commented 4 months ago

I could see that being a useful feature(making common prompts faster), but I think this would make more sense as a block command and executed via context menu of the command? what do you think?

gixita commented 4 months ago

I have been using LogSeq and Ollama for some time now, but I haven't used the Ollama-LogSeq plugin a lot, so I can't comment on the most effective way to trigger the LLM. As a new user, I intuitively selected text, clicked the plugin icon, and chose an option from the displayed menu. This lead me to implement it that way. Could you explain what is "block command and executed via context menu" mean exactly ?

omagdy7 commented 4 months ago

Block commands are commands that are available when you right click on a block like this: image

gixita commented 4 months ago

Hello, Thank you for the tip, it was easier to do by using Block commands. Let me know if you would like something modified.