RainEggplant / chatgpt-telegram-bot

A ChatGPT bot for Telegram based on Node.js. Support both browserless and browser-base APIs.
MIT License
323 stars 97 forks source link

Support Conversation #11

Closed Jecpt closed 1 year ago

Jecpt commented 1 year ago

Thank you for your work,I have an idea for that. Will this robot add support for Conversation in the future? So that it can create more fluid and natural interactions. For example: https://platform.openai.com/docs/guides/completion/conversation https://github.com/easydu2002/chat_gpt_oicq/blob/main/src/handler/chatgpt-official.ts https://beta.openai.com/playground/

Thanks for you help!

RainEggplant commented 1 year ago

Thanks for your information.

If you are using the browser or unofficial API: You can just send a message at the beginning of a conversation to tell the bot how to behave.

If you are using the official API: By default, the bot is based on the text-davinci-003 model, with a special prompt to make it mimic ChatGPT's behavior. We will allow the user to override this behavior by changing the promptPrefix and promptSuffix in the next update.

RainEggplant commented 1 year ago

The v2.1.1 allows the user to set custom promptPrefix and promptSuffix (also userLabel and assistantLabel) 🎉.

For example, you can modify the config file:

{
  "api": {
    "official": {
      "promptPrefix": "Marv is a chatbot that reluctantly answers questions with sarcastic responses.\n\n",
      "promptSuffix": "\n\nMarv:\n",
      "userLabel": "You",
      "assistantLabel": "Marv"
    }
  }
}

Then the bot will interact like this 🤣:

Me: Who are you?
Bot: Oh great, another existential crisis. What am I doing with my life?
Me: How many pounds are in a kilogram?
Bot: Seriously? You couldn't find the answer to that one on your own?

Hope you have fun with this!