joaopcm / snipshare

Revolutionize your coding experience with Snipshare - the all-in-one platform for creating, executing, and sharing Node.js code snippets! Join the coding revolution today at www.snipshare.co 🚀🌟
https://www.snipshare.co
MIT License
61 stars 3 forks source link

feat: ask AI feature #18

Closed joaopcm closed 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
nodepad-app ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 24, 2023 at 0:38AM (UTC)
joaopcm commented 1 year ago

@NicolasLopes7, do you think we should provide the OpenAI API Key?

I ask this because OpenAI gives $18 for testing. I am currently using this budget to make things work in this PR. To get around this, I thought of the following flow:

  1. User clicks on the "Ask AI" button;
  2. We check if the answer is not already saved in Redis;
  3. If not, we open a modal for the user to provide his token;
  4. We save the user's API Key in local storage;
  5. We use the provided API key to consume the AI;

Which option do you think is better?

NicolasLopes7 commented 1 year ago

@NicolasLopes7, do you think we should provide the OpenAI API Key?

I ask this because OpenAI gives $18 for testing. I am currently using this budget to make things work in this PR. To get around this, I thought of the following flow:

  1. User clicks on the "Ask AI" button;
  2. We check if the answer is not already saved in Redis;
  3. If not, we open a modal for the user to provide his token;
  4. We save the user's API Key in local storage;
  5. We use the provided API key to consume the AI;

Which option do you think is better?

Yeah, I think this is the only possible way to use the AI thing without spending money. But, bring honest I wouldn't put my keys on an app. This is probably a good time to start a premium AI plan 👀

joaopcm commented 1 year ago

Looks good overall! I think we can create another PR refactoring the whole AI thing to a service/hook/anything. I think zustand's store would be agreat approach.

@NicolasLopes7, I just started a discussion to talk about zustand's store on Nodepad here :)

star-wars-dancing-gif

joaopcm commented 1 year ago

@NicolasLopes7, do you think we should provide the OpenAI API Key? I ask this because OpenAI gives $18 for testing. I am currently using this budget to make things work in this PR. To get around this, I thought of the following flow:

  1. User clicks on the "Ask AI" button;
  2. We check if the answer is not already saved in Redis;
  3. If not, we open a modal for the user to provide his token;
  4. We save the user's API Key in local storage;
  5. We use the provided API key to consume the AI;

Which option do you think is better?

Yeah, I think this is the only possible way to use the AI thing without spending money. But, bring honest I wouldn't put my keys on an app. This is probably a good time to start a premium AI plan 👀

@NicolasLopes7 Sounds good! Since the Nodepad is at an early stage and at a very nice pace, I will deliver this feature of using AI while I work on an authentication + payment method to work with plans and make this feature (and others) a premium feature.

I believe that to add a premium plan, we should offer more unique features as well. I believe Nodepad is on its way to do that.

About the $18 budget, I believe I can deliver authentication + payments (using Stripe) to make these features exclusive to premium members.

I think I can handle authentication using social login with next-auth. Payments with Stripe.

That's it! I'll come back soon with news about it :) Thanks!

joaopcm commented 1 year ago

:tada: This PR is included in version 1.8.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: