bramses / chatgpt-md

A (nearly) seamless integration of ChatGPT into Obsidian.
MIT License
824 stars 61 forks source link

Add an option to call API only in chat files #45

Closed szw closed 1 year ago

szw commented 1 year ago

I found sending just any file to the Chat GPT API with one command/hotkey too easy. This option limits the command/hotkey usage to "chat" files. The chat files are recognized by the frontmatter having the model field with "gpt" string inside.

bramses commented 1 year ago

Hi @szw, thanks for the PR! Many people use ChatGPT MD in their existing notes outside of the chat folder. See relevant conversation about whether or not ChatGPT should work in existing notes here: https://github.com/bramses/chatgpt-md/discussions/44 and please make your case there!

szw commented 1 year ago

Hi @bramses! My problem was that if I accidentally pressed the call-chatgpt-api hotkey (without any divider), the whole note was sent to Chat GPT API. And that could lead to leaking potentially sensitive information. That's why I added the option to prevent this behavior.

bramses commented 1 year ago

Ah yeah I see your point. Ok cool, I'll add it as a toggle setting in an upcoming release to require "chat" key in frontmatter if not in the chats folder

szw commented 1 year ago

I am closing this one in favor of #47. #47 allows for more flexibility using Chat GPT inside regular notes while preventing accidental calls. If the option is enabled, at least one divider is necessary to trigger a new Chat GPT API call. The text above the divider is removed from the context.