whatsapp-chatgpt icon indicating copy to clipboard operation
whatsapp-chatgpt copied to clipboard

Open AI error after logging into the whatsapp

Open RadientBrain opened this issue 1 year ago • 4 comments

Getting openai error:

An error occured, please contact the administrator. (OpenAI error 400: {
  "error": {
    "message": "This model's maximum context length is 4097 tokens. However, you requested 4147 tokens (51 in the messages, 4096 in the completion). Please reduce the length of the messages or completion.",
    "type": "invalid_request_error",
    "param": "messages",
    "code": "context_length_exceeded"
  }
}
)

RadientBrain avatar Oct 01 '23 17:10 RadientBrain

Same here... tried changing the model to gpt-4 but that didn't fix the problem.

moeliciouz avatar Oct 02 '23 14:10 moeliciouz

I got to make it work by changing the token limit in the config file from 4096 to maybe 7000 and changing the model to gpt-4 as well!

RadientBrain avatar Oct 02 '23 17:10 RadientBrain

Also try this fix in env file:

# In case you run into ratelimit on a single organization token, you might setting up multiple API keys here
# Example:
# OPENAI_API_KEYS=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Isaakkamau avatar Oct 02 '23 18:10 Isaakkamau

Thanks @Isaakkamau , it's working now :)

moeliciouz avatar Oct 02 '23 22:10 moeliciouz