capibawa / wumpus-gpt

ChatGPT-like Discord chatbot written in TypeScript and powered by OpenAI's `gpt-4` and `gpt-3.5-turbo` language models.
https://discord.com/api/oauth2/authorize?client_id=1054835849893793872&permissions=397284550656&scope=bot
MIT License
26 stars 18 forks source link

I can't use GPT-4 api #4

Closed 0xydev closed 1 year ago

0xydev commented 1 year ago

I changed the places I needed to change. But when I run the bot it gives the answers as gpt-3.

capibawa commented 1 year ago

@0xydev The only thing you need to do is set the OPENAI_MODEL field to gpt-4 in your .env file. Then, restart the bot if it's already running.

0xydev commented 1 year ago

The bot is working, but when I ask the bot which version it's using, I get GPT-3 as the answer. When I ask the same question to Chat GPT Plus, I get GPT-4 as the answer. I'm not sure if there's a problem with the API or if it stems from the GPT-3 tokenizer in your code. How else can I test it?

capibawa commented 1 year ago

@0xydev GPT-4 isn’t aware of its own version, ChatGPT likely has a system prompt set to avoid that confusion. I can think of two ways you can confirm that the bot is using GPT-4:

  1. Log the request payload before it’s sent to the API, ensuring that model is indeed gpt-4.
  2. Ask the bot, “There are 50 books in a library. Sam decides to read 5 of the books. How many books are there now?” If it responds with 45, it is likely not GPT-4.