AICommitApp / community

Streamline your coding process with AI-powered commit suggestions.
https://aicommit.app
MIT License
15 stars 1 forks source link

OpenAI API Error: 400 - Bad Request #4

Closed MattRiddell closed 1 year ago

MattRiddell commented 1 year ago

Describe the bug: When trying to generate a commit message it says the request is too long

Steps to reproduce:

aicommits --all                                                                                                                                                                                             ─╯
┌   aicommits 
│
◇  Detected 3 staged files:
     dist/app.js
     dist/app.js.map
     src/app.ts
│
◇  Changes analyzed
│
└  ✖ OpenAI API Error: 400 - Bad Request

{
  "error": {
    "message": "This model's maximum context length is 4097 tokens. However, you requested 4103 tokens (3903 in the messages, 200 in the completion). Please reduce the length of the messages or completion.",
    "type": "invalid_request_error",
    "param": "messages",
    "code": "context_length_exceeded"
  }
}

Expected behavior: it works

rosuH commented 1 year ago

Hi, I understand your concern, but it appears that you are not using our product, but rather https://github.com/Nutlope/aicommits. Our product solves this problem by segmenting text content. We welcome you to try it out: https://plugins.jetbrains.com/plugin/21289-aicommit 😸