Home ยป I made an algorithm to access the older and smarter ‘March 2023’ model of GPT-4 and have continuous conversations with it using a telegram bot

I made an algorithm to access the older and smarter ‘March 2023’ model of GPT-4 and have continuous conversations with it using a telegram bot

by satcit

Steps involved

  • Install Node RED on your server/PC/Raspberry Pi
  • Install the string manipulation node on your Node-RED
  • Copy the code for the Node-RED flow from this pastebin link
  • Go to your Node-RED GUI and import the flow to your Node-RED
  • Create a new telegram bot using the BotFather bot on Telegram and get the bot token
  • Paste the Telegram bot token in either Telegram Sender or Telegram receiver node in the already imported Node Red flow.
  • Double-click and open function node 26 in the flow and replace YOUR_TELEGRAM_CHAT_ID with your Telegram chat ID. You can get your Telegram chat ID by messaging myidbot on Telegram. There are other methods to get your Telegram chat ID, but I usually use this method.
  • Go to the two nodes named ‘OpenAI API Key here’ and replace YOUR_OPENAI_API_KEY with your OpenAI API key in each of the nodes
  • That should be it. Now go to the Telegram bot that you had previously created and press ‘start’
  • Now you can start chatting with gpt-4-0314 which is the March version of GPT-4.

Continous conversation mode

To start a continuous conversation with the AI, put two question marks in the beginning. Like this:

?? Hello

And type the follow up questions normally without the question mark. Like so:

?? Which is the busiest city in the UK?

How can I go there from Liverpool?

Is there any other option?

When would be the best time to leave from Liverpool?

Till you type another message with two question marks in the front, it will be a continuous conversation.

Bear in mind that continuous conversations will use more tokens as you are actually sending a JSON with all the chat from the last time you used ‘??‘, every time you call the API.

Normal Mode (without continuous conversations)

To use the bot in normal mode without continuous conversations, just type all your messages with two question marks in front. Like so:

??Hi

??How are you

?? Can you be my friend?

You may also like

Leave a Comment