logancyang / obsidian-copilot

THE Copilot in Obsidian
GNU Affero General Public License v3.0
2.6k stars 181 forks source link

Alternative method for interacting with custom prompts #590

Closed pedramamini closed 1 week ago

pedramamini commented 1 week ago

I've kicked the tires on various GenAI implementation plug-ins in Obsidian. One of the better patterns for managing custom prompts is to configure a folder containing them. This allows for a single source of prompts to be used across multiple GenAI integrations (including outside of Obsidian via the .md files on disk).

Perhaps should be a separate issue, but then being able to interface with the prompts, through the copilot chat, via tab-completable @PROMPTNAME. So when you're chatting with CoPilot directly, you can invoke a prompt easily.

logancyang commented 1 week ago

I'm actually moving custom prompts to markdown out of pouchdb to support Obsidian Sync next, since mobile support is out now. So this is coming. #591

Will think about how tab completion for prompts should work. Copilot prompts are templates with selection, note titles, paths and tags, and not just some "Act like x" sort of pure text prompt. Most likely I'll have /prompt show a list of prompts, selecting one puts the custom prompt in the chat input. Then Copilot knows how to render the template because it's a /prompt command.

logancyang commented 1 week ago

@pedramamini btw what's your favorite plugin among your tested ones? Not sure if there can be a unified pattern using markdown for custom prompts.

For now I'm thinking one custom prompt per md file under a specified folder. Any specific suggestion is welcome.

pedramamini commented 1 week ago

Yes, one prompt per MD is probably the best way. I've played with:

Ayanite is the cleanest, here are some screen grabs:

image

/ (Search chat commands) image

' (Search message history) image

@ (Search models and profiles) image

; (Search recent chats) image

. (Search prompts) image

Some settings grabs:

image

image

image

pedramamini commented 1 week ago

Bleh not sure what happened there with email response or comment editing, but the screen grabs should be accessible now.

logancyang commented 1 week ago

@pedramamini nice thanks! Haven't seen Ayanite, looks pretty good, and I didn't know you can have it closed-sourced and still distribute in the Obsidian plugin store. My plan for copilot is quite similar. For chat experience, the inspiration I'm looking at is mostly https://github.com/mckaywrigley/chatbot-ui.

logancyang commented 1 week ago
pedramamini commented 1 week ago

Nice work on the folder usage. Love it!

On Fri, Sep 06, 2024 at 8:47 AM, Logan Yang < @.*** > wrote:

  • Custom prompt in folder done, don't forget to use the new command Dump custom prompts to markdown files for existing prompts.
  • Prompt trigger in chat

— Reply to this email directly, view it on GitHub ( https://github.com/logancyang/obsidian-copilot/issues/590#issuecomment-2334097536 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAJSBRIGSVK3YZE6X2BA5M3ZVGW6PAVCNFSM6AAAAABNUSOBG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUGA4TONJTGY ). You are receiving this because you were mentioned. Message ID: <logancyang/obsidian-copilot/issues/590/2334097536 @ github. com>