AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
58.2k stars 3.83k forks source link

[FR] : Allow custom prompt for users to generate content through GPT #2286

Open Akif-Vohra opened 1 year ago

Akif-Vohra commented 1 year ago

Description

As a user I would like to have the ability to add prompt for generating content through openAI..

For example if there was a third option in this menu which opened a text box for me to type my own prompt. So after "Summarise" and "Fix spelling" there could be a 3rd option "Enter your own prompt"

image

For example if I am making a note to learn spanish it would be helpful for me to type in "Give me list of 10 spanish greetings" or highlight something I wrote in spanish and type "Check my sentence if there are mistakes in it."

Impact

I think this can greatly enhance user experience and productivity for all users of AppFlowy.

Additional Context

I am not proficient in flutter but I have experience with JavaScript and Python. But I am currently taking a look at getting started guide for development, may be I can implement something like this?

Xazin commented 1 year ago

I think it would make sense if it simply worked like all of the current AI features, where you make a selection, and then you have something like "Generate from selection".

Akif-Vohra commented 1 year ago

Thank you for your reply! I had the same thought as well.

My personal use case was something like this: I wanted to highlight a list of 10 items where each item in the list was as follows.

Sentence1 - Sentence1 in German that I did myself. Sentence1 - Sentence2 in German that I did myself.

Now, if I wanted to use GPT to highlight my mistakes in bold, I would need to add a line "Check the following translations and highlight my mistakes in bold" at the end or beginning before selecting the whole text, which is not a problem but may not be as intuitive, I think.

But I admit that just generating content from selection is more straightforward and will be fine for me as a user :)

While I'm on the topic, my personal use case assumes that we can insert markdown-formatted text in AppFlowy, but is this really the case? I recently tried to copy a list from ChatGPT to AppFlowy, and it did not copy. I assumed this was because copying from Markdown is probably not yet supported

Xazin commented 1 year ago

I'm not entirely sure I understand, in your scenario you want to "highlight" mistakes in bold, but isn't the fix spelling sufficient for your usecase?

annieappflowy commented 1 year ago

I suppose it's similar to https://github.com/AppFlowy-IO/AppFlowy/issues/1970

annieappflowy commented 1 year ago

Could you please submit another issue to report this bug?

I recently tried to copy a list from ChatGPT to AppFlowy, and it did not copy.

Please provide us with the text you wanted to copy.

Akif-Vohra commented 1 year ago

I'm not entirely sure I understand, in your scenario you want to "highlight" mistakes in bold, but isn't the fix spelling sufficient for your usecase?

Unfortunately in my personal use case it was more than spelling. it was about changing grammar and semantics of the written text.

The clock is ticking on the wall : Die Uhr tickt um der Wand.

In above sentence "um" is grammatically incorrect. It should be "an", So I would like to highlight it and say "Give me correct sentence" which ideally should insert as follows.

If I highlight the german part of the sentence in AppFlowy and use fix spelling menu, it gives me following.

image

Compare this to a prompt i made for language helper.

image

So if we had an option to enter a custom prompt so user can run it against any highlighted text it would be really helpful. Additionally if user can save a prompt OR we can show recently used prompt, it will be a really good addition.

Actually I was able to perform this exact thing in one other commercial editor which is similar to AppFlowy. However, i like the idea of using my opensource and having editor locally hosted so I switched to AppFlowy and then realised that this feature could possibly be implemented in AppFlowy too.

Akif-Vohra commented 1 year ago

Could you please submit another issue to report this bug?

I recently tried to copy a list from ChatGPT to AppFlowy, and it did not copy.

Please provide us with the text you wanted to copy.

Hey! sure. I created a bug report with full details. https://github.com/AppFlowy-IO/AppFlowy/issues/2288

Xazin commented 1 year ago

I'm not entirely sure I understand, in your scenario you want to "highlight" mistakes in bold, but isn't the fix spelling sufficient for your usecase?

Unfortunately in my personal use case it was more than spelling. it was about changing grammar and semantics of the written text.

The clock is ticking on the wall : Die Uhr tickt um der Wand.

In above sentence "um" is grammatically incorrect. It should be "an", So I would like to highlight it and say "Give me correct sentence" which ideally should insert as follows.

If I highlight the german part of the sentence in AppFlowy and use fix spelling menu, it gives me following.

image

Compare this to a prompt i made for language helper.

image

So if we had an option to enter a custom prompt so user can run it against any highlighted text it would be really helpful. Additionally if user can save a prompt OR we can show recently used prompt, it will be a really good addition.

Actually I was able to perform this exact thing in one other commercial editor which is similar to AppFlowy. However, i like the idea of using my opensource and having editor locally hosted so I switched to AppFlowy and then realised that this feature could possibly be implemented in AppFlowy too.

Alright it makes sense. The prompt we use to trigger the AI in my opinion can be a bit loose.

It might be an idea to modify the existing fix spelling into an overall command that fixes spelling, grammar, and punctuation.