DEV Community

Discussion on: Master Notifications With ChatGPT, React and NodeJS ๐Ÿงจ

Collapse
 
jeremydayslice profile image
Jeremy Zaborowski

I appreciate the blog post as an educational demo, but I'm not sure it's a good idea to build anything in production that relies on scraping a research preview that is likely to change and will certainly end up behind a paywall shortly. I imagine that when that happens, they will also be exposing the API for the same or lower cost anyway.

Also, when testing this out, I was not able to get a consistent response from ChatGPT. Often it would ignore the command to not include an intro, which I assume is an issue with its inherent goal of being conversational.

I also thought the temperature (creativity) of ChatGPT resulted in some undesired results. For example, when their subscription was running out, it basically just said "see ya", instead of encouraging the user to update their account.

Image description

With the GPT3 API though, I was able to get very consistent results, using a temperature of .35.

For anyone looking to implement this really helpful tutorial, but using GPT3, here is the prompt I used. Providing an example is a great way to ensure you get a consistent output, by the way.

Write the text for a user notification with the title, "Your subscription is ending in a week."
use a variable, {{user}} for the user's name.

Title: You have a new message
Notification: Hey, {{user}}, you just received a new message, check out your inbox to read it.

Title: "Your subscription is ending in a week"
Notification:
Enter fullscreen mode Exit fullscreen mode

By constructing your prompt in this way, it will finish your text by only adding the notification text, ensuring you never get any intro text like with ChatGPT.

Image description

Collapse
 
nevodavid profile image
Nevo David

Thank you for posting this!
I disagree with you about production use.
It can be used in production for background processing.
I am building now a notification directory that is mainly built in GPT3.
Do I need people to go around and validate stuff? sure!
It's still pretty crazy.

Collapse
 
jimmoo profile image
Jim Moore

I'd follow this tute if it were using SolidJS. React is the Windows of JS frameworks, imo