DEV Community

Cover image for Building the largest Notifications Library in the world using ChatGPT, React, and NodeJS 🤯

Building the largest Notifications Library in the world using ChatGPT, React, and NodeJS 🤯

Nevo David on February 13, 2023

TLDR; I am going to show you how to create a notification library like on this website: https://notifications.directory I will show you...
Collapse
 
stepanzak profile image
Štěpán Žák

This is a really cool use for an AI.

Collapse
 
nevodavid profile image
Nevo David

Thank you Štěpán 🤩 how are you today?
Do you have any use for it?

Collapse
 
mohammadparsajavidi profile image
mohammadparsa-javidi

Perfect 👏👌

Collapse
 
nevodavid profile image
Nevo David

Thank you 🙏🏻😊

Collapse
 
ra1nbow1 profile image
Matvey Romanov

Wow! That's truly amazing

Collapse
 
nevodavid profile image
Nevo David

Thank you ❤️

Collapse
 
mtariqsajid profile image
Tariq Sajid

I am not able to us this package in Adonis js typescript. You mention that this library use esm and not common js how to import and use this in adonis js ?

Collapse
 
nevodavid profile image
Nevo David

You can do something like this:

import type { ChatGPTClient } from '@waylaidwanderer/chatgpt-api';
const { ChatGPTClient: chat } = await (eval(
      `import('@waylaidwanderer/chatgpt-api')`,
    ) as Promise<{
      default: typeof ChatGPTClient;
    }>);

    const lib = new chat(process.env.CHATGPT_API, {
      reverseProxyUrl: 'https://chatgpt.hato.ai/completions',
      modelOptions: {
        model: 'text-davinci-002-render',
      },
    });
Enter fullscreen mode Exit fullscreen mode

If you are using plain javascript, just remove the typing

Collapse
 
jjmpsp profile image
Joel Murphy

Just tried following this tutorial but it seems the method no longer works. See: github.com/waylaidwanderer/node-ch...

Collapse
 
nevodavid profile image
Nevo David

Thank you,
They will probably launch a new server soon :)

Collapse
 
nevodavid profile image
Nevo David

Have you used ChatGPT for coding before?

Collapse
 
nandansn profile image
Nandakumar R

yes

Collapse
 
nevodavid profile image
Nevo David

For what use case? :)

Thread Thread
 
nandansn profile image
Nandakumar R

i used for code refactoring

Collapse
 
takmanjim profile image
takmanjim

Perfect thanks a lot

Collapse
 
nevodavid profile image
Nevo David

🎉
Hope you will find it a good use!

Collapse
 
nevodavid profile image
Nevo David

Hi Friends!
If you want to know exactly when I post, just register to my newsletter here

Collapse
 
nevodavid profile image
Nevo David

How are you today? :)

Collapse
 
bakardev profile image
Muhib ur Rahman Bakar

Great. Thanks for posting.

Collapse
 
nevodavid profile image
Nevo David

Thank you for reading

Collapse
 
nayanika12 profile image
Nayanika-12

Image description

Could u please help me as to where shall I correct my code?