Open lvffilho opened 1 year ago
I donÂŽt know what happended, but after some time, worked again.
same here if I delete or rename a file (sometimes it works as normal)
i am having this issue right after installing the program.
Getting a 400 too.
And this:
â
â Generating the commit message
â
â â {"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.\nDo not preface the commit with anything.\nDon't add any descriptions to the commit, only commit message.\nUse the present tense. Lines must not be longer than 74 characters. Use english to answer."},{"role":"user","content":"diff --git a/src/server.ts b/src/server.ts\nindex ad4db42..f3b18a9 100644\n--- a/src/server.ts\n+++ b/src/server.ts\n@@ -10,7 +10,7 @@\nimport {\n initWinstonLogger();\n \n const app = express();\n -const port = 7799;\n +const PORT = 7799;\n \n app.use(express.json());\n \n@@ -34,6 +34,6 @@\napp.use((_, res, next) => {\n // ROUTES\n app.use(PROTECTED_ROUTER_URL, protectedRouter);\n \n -app.listen(port, () => {\n - console.log(`Server listening on port ${port}`);\n +app.listen(process.
I think this has more to do with maximum token length than anything, I think we need to implement some form of token counting to make sure that the get diff is not too long
I suggest adjusting the MAX_TOKEN configuration to a lower value. In my case, I found that setting it to 1100 worked well. When the value was lower than that, I encountered 429 status, and when it was higher, I encountered 400 status. It seems there might be a logic issue related to the token limit, which is determined by the line
const MAX_REQ_TOKENS = 3000 - INIT_MESSAGES_PROMPT_LENGTH
@gamoreli you are the hero!
but it actually looks like when you create a large file and it can not be split by line changes like 30-50, 40-70 (because it's a new file creation and not update of an old file), so it's more than 4029 tokens which is max for gpt-3.5-turbo
so, if this fix by @gamoreli doesn't help you:
.lock
filesoco config set OCO_MODEL=gpt-4
(it's more expensive, but it didn't ever go higher $1 a day for me)For serious thou, on large file change it could just say "Refactored: file name"
On Sat, May 27, 2023, 11:21 AM Sukharev @.***> wrote:
@gamoreli https://github.com/gamoreli you are the hero!
but it actually looks like when you create a large file and it can not be split by line changes like 30-50, 40-70 (because it's a new file creation and not update of an old file), so it's more than 4029 tokens which is max for gpt-3.5-turbo
so, if this https://github.com/di-sukharev/opencommit/issues/170#issuecomment-1561849045 fix by @gamoreli https://github.com/gamoreli doesn't help you:
- we can think of a PR to omit large files, at least images which are not skipped now. we now skip only .lock files
- commit your large file yourself, i know we are all too lazy now doing it manually :)
- switch to oco config set OCO_MODEL=gpt-4 (it's more expensive, but it didn't ever go higher $1 a day for me)
â Reply to this email directly, view it on GitHub https://github.com/di-sukharev/opencommit/issues/170#issuecomment-1565494264, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VUYHVNZA5UXHPVU2NTXIILWBANCNFSM6AAAAAAX64NAKY . You are receiving this because you commented.Message ID: @.***>
@gamoreli you are the hero!
but it actually looks like when you create a large file and it can not be split by line changes like 30-50, 40-70 (because it's a new file creation and not update of an old file), so it's more than 4029 tokens which is max for
gpt-3.5-turbo
so, if this fix by @gamoreli doesn't help you:
- we can think of a PR to omit large files, at least images which are not skipped now. we now skip only
.lock
files- commit your large file yourself, i know we are all too lazy now to do it manually :)
- switch to
oco config set OCO_MODEL=gpt-4
(it's more expensive, but it didn't ever go higher $1 a day for me)
I had created another method to break the line into words but I thought it was too much đ
How can I resolve this error?
Getting a 400 too.
And this:
â â Generating the commit message â â â {"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.\nDo not preface the commit with anything.\nDon't add any descriptions to the commit, only commit message.\nUse the present tense. Lines must not be longer than 74 characters. Use english to answer."},{"role":"user","content":"diff --git a/src/server.ts b/src/server.ts\nindex ad4db42..f3b18a9 100644\n--- a/src/server.ts\n+++ b/src/server.ts\n@@ -10,7 +10,7 @@\nimport {\n initWinstonLogger();\n \n const app = express();\n -const port = 7799;\n +const PORT = 7799;\n \n app.use(express.json());\n \n@@ -34,6 +34,6 @@\napp.use((_, res, next) => {\n // ROUTES\n app.use(PROTECTED_ROUTER_URL, protectedRouter);\n \n -app.listen(port, () => {\n - console.log(`Server listening on port ${port}`);\n +app.listen(process.
Where you able to resolve this error?
I think there is an issue with sending the commit creation command. I have made updates to the database, which includes a lot of repetitive information across different files. As a result, I have a huge chunk of text to send, even though the actual action took only a few minutes. Considering the cost of sending it to the API, I don't want to make commits every 5 minutes. It would be helpful to reduce the amount of text being sent or, at the very least, avoid repetition when the modification applies to multiple lines with identical criteria. Here is the chunk that OC was trying to send:
oco
â open-commit
â
â 4 staged files:
frontend/src/components/Navigation.js
frontend/src/components/data/ProductCard.js
frontend/src/data/productList.js
frontend/src/sass/pages/_productCard.scss
â
â Generating the commit message
â
â â {"model":"gpt-4","messages":[{"role":"system","content":"You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.\nDo not preface the commit with anything.\nDon't add any descriptions to the commit, only commit message.\nUse the present tense. Lines must not be longer than 74 characters. Use française to answer."},{"role":"user","content":"diff --git a/src/server.ts b/src/server.ts\nindex ad4db42..f3b18a9 100644\n--- a/src/server.ts\n+++ b/src/server.ts\n@@ -10,7 +10,7 @@\nimport {\n initWinstonLogger();\n \n const app = express();\n -const port = 7799;\n +const PORT = 7799;\n \n app.use(express.json());\n \n@@ -34,6 +34,6 @@\napp.use((_, res, next) => {\n // ROUTES\n app.use(PROTECTED_ROUTER_URL, protectedRouter);\n \n -app.listen(port, () => {\n - console.log(`Server listening on port ${port}`);\n +app.listen(process.env.PORT || PORT, () => {\n + console.log(`Server listening on port ${PORT}`);\n });"},{"role":"assistant","content":"corriger(server.ts) : changer la casse de la variable de port de minuscules Ă majuscules (PORT)\nfonctionnalitĂ©(server.ts) : ajouter la prise en charge de la variable d'environnement process.env.PORT\n"},{"role":"user","content":"diff --git a/frontend/src/components/Navigation.js b/frontend/src/components/Navigation.js\nindex 5dae2c2..846bd6b 100644\n--- a/frontend/src/components/Navigation.js\n+++ b/frontend/src/components/Navigation.js\n@@ -12,9 +12,7 @@ const Navigation = () => {\n \"Bien-ĂȘtre\",\n \"Huiles essentielles\",\n \"Purification\",\n- \"Enfants\",\n- \"Sport\",\n- \"Produits de saison\",\n+ \"Profils particuliers\",\n ];\n \n return (\n@@ -39,12 +37,7 @@ const Navigation = () => {\n <div className=\"all-menu-navbar\">\n {/* rĂ©cupĂšre la totalitĂ© des menus des produits et les intĂšgres Ă une balise \"li\" */}\n {category.map((menu, index) => (\n- <li\n- className={`menu-navbar ${\n- index === category.length - 1 ? \"textColor\" : \"\"\n- }`}\n- key={index}\n- >\n+ <li className={`menu-navbar ${index}`} key={index}>\n <NavLink className=\"cursor\">\n <button className=\"btn btn-navbar\">{menu}</button>\n </NavLink>\ndiff --git a/frontend/src/components/data/ProductCard.js b/frontend/src/components/data/ProductCard.js\nindex 16f2be0..3d5f307 100644\n--- a/frontend/src/components/data/ProductCard.js\n+++ b/frontend/src/components/data/ProductCard.js\n@@ -23,7 +23,7 @@ const Product = ({ product, index }) => {\n onMouseLeave={handleMouseLeave}\n >\n <div className=\"productCard\">\n- <img key={index} src={product.picture} alt={product.altPicture} />\n+ <img key={index} src={product.picture} alt={product.nameProduct} />\n <div className=\"textProductCard\">\n <h1>{product.nameProduct} </h1>\n <h2>{product.summary.title} </h2>\n@@ -36,11 +36,9 @@ const Product = ({ product, index }) => {\n const Card = () => {\n return (\n <main className=\"arrayProductCard\">\n- {Array.from({ length: 20 }).map(() =>\n- productList.map((product) => (\n- <Product key={product.id} product={product} />\n- ))\n- )}\n+ {productList.map((product) => (\n+ <Product key={product.id} product={product} />\n+ ))}\n </main>\n );\n };\ndiff --git a/frontend/src/data/productList.js b/frontend/src/data/productList.js\nindex d178930..0ea4cb0 100644\n--- a/frontend/src/data/productList.js\n+++ b/frontend/src/data/productList.js\n@@ -52,12 +52,195 @@ export const productList = [\n getSecondCategoryById(\"1Sante3Pathologies\").text,\n ],\n picture: \"./img/png/product/0_1_white.png\",\n- altPicture: \"Photo du produit La DĂ©tox\",\n },\n {\n nameProduct: \"Le BB\",\n summary: {\n- title: \"Un complĂ©ment pour une beautĂ© totale.\",\n+ title: \"Le secret dâun Ă©clat intĂ©rieur et extĂ©rieur\",\n+ paragraph: [\n+ {\n+ text: \"RĂ©vĂ©lez votre Ă©clat intĂ©rieur et extĂ©rieur avec ce complĂ©ment qui offre une combinaison unique d'ingrĂ©dients pour une santĂ© optimale de vos cheveux, des ongles, de votre peau et de votre bien-ĂȘtre global.\",\n+ },\n+ {\n+ text: \"Sa formule exclusive renferme un mĂ©lange d'ingrĂ©dients qui apportent de nombreux bienfaits pour la santĂ©, en particulier si vous souhaitez complĂ©ter votre apport quotidien en vitamines. Conçu spĂ©cifiquement pour rĂ©pondre aux besoins nutritionnels des cheveux, des ongles et de la peau, le BB ne se limite pas Ă l'aspect externe. \",\n+ },\n+ {\n+ text: \"Votre bien-ĂȘtre interne bĂ©nĂ©ficiera Ă©galement des vitamines, des minĂ©raux et des bioflavonoĂŻdes contenus dans ce complĂ©ment, tous extraits naturellement de plantes.\",\n+ },\n+ {\n+ text: \"Que vous souhaitiez renforcer votre santĂ© globale ou simplement dynamiser votre routine beautĂ©, ce puissant complĂ©ment vous procurera une sensation de renouveau et de vitalitĂ©.\",\n+ },\n+ ],\n+ },\n+ firstCategory: [\n+ getCategoryById(\"1Sante\").name,\n+ getCategoryById(\"2Beaute\").name,\n+ getCategoryById(\"3BienEtre\").name,\n+ getCategoryById(\"6ProfilsParticuliers\").name,\n+ ],\n+ secondCategory: [\n+ getSecondCategoryById(\"1Sante0ProblemesCutanes\").text,\n+ getSecondCategoryById(\"1Sante2SystemesCorps\").text,\n+ getSecondCategoryById(\"2Beaute0SoinsCheveux\").text,\n+ getSecondCategoryById(\"2Beaute2SoinsCorps\").text,\n+ getSecondCategoryById(\"3BienEtre1Energie\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers1Enfants\").text,\n+ ],\n+ picture: \"./img/png/product/0_1_white.png\",\n+ },\n+ {\n+ nameProduct: \"La 8Ăšme merveille du Monde\",\n+ summary: {\n+ title: \"Un produit brevetĂ© et unique\",\n+ paragraph: [\n+ {\n+ text: \"Ce produit est brevetĂ© et donc disponible seulement dans notre boutique. Il est unique car a Ă©tĂ© formulĂ© avec 36 des ingrĂ©dients naturels les plus puissants du monde. Chaque gourde contient une purĂ©e de fruits entiers, de champignons, dâhuiles essentielles et dâherbes aromatiques du monde entier.\",\n+ },\n+ {\n+ text: \"Ces 36 superaliments ont Ă©tĂ© sĂ©lectionnĂ©s pour leurs propriĂ©tĂ©s Ă©nergisantes, antioxydantes, leurs propriĂ©tĂ©s anti-inflammatoires et leurs bienfaits sur lâorganisme.\",\n+ },\n+ {\n+ text: \"Petit plus, il accĂ©lĂšre le bronzage en donnant un teint hĂąlĂ©\",\n+ },\n+ ],\n+ },\n+ firstCategory: [\n+ getCategoryById(\"1Sante\").name,\n+ getCategoryById(\"3BienEtre\").name,\n+ getCategoryById(\"6ProfilsParticuliers\").name,\n+ ],\n+ secondCategory: [\n+ getSecondCategoryById(\"1Sante0ProblemesCutanes\").text,\n+ getSecondCategoryById(\"1Sante1TroublesDigestifsIntestinauxRespiratoires\")\n+ .text,\n+ getSecondCategoryById(\"1Sante2SystemesCorps\").text,\n+ getSecondCategoryById(\"1Sante3Pathologies\").text,\n+ getSecondCategoryById(\"3BienEtre1Energie\").text,\n+ getSecondCategoryById(\"3BienEtre2FatigueSommeil\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers0Femmes\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers1Enfants\").text,\n+ ],\n+ picture: \"./img/png/product/0_1_white.png\",\n+ },\n+ {\n+ nameProduct: \"Le booster dâĂ©nergie\",\n+ summary: {\n+ title: \"Un mĂ©lange vivifiant pour booster votre journĂ©e !\",\n+ paragraph: [\n+ {\n+ text: \"Un produit incroyable qui regorge de bienfaits sur votre santĂ© physique et mentale. \",\n+ },\n+ {\n+ text: \"Avec ses prĂ©cieux nutriments, il apporte une Ă©nergie revitalisante, combat la fatigue, amĂ©liore lâattention et la vigilance mentale et booste le systĂšme immunitaire et cardiovasculaire.\",\n+ },\n+ {\n+ text: \"Il offre une meilleure qualitĂ© de sommeil, une humeur positive en Ă©liminant le stress, les angoisses et le surmenage. Une sensation de sĂ©rĂ©nitĂ©, de calme et de relaxation se fait ressentir. \",\n+ },\n+ {\n+ text: \"Les ingrĂ©dients sĂ©lectionnĂ©s dans ce produit ont Ă©galement des effets antioxydants et anti-inflammatoires qui permettent dâattĂ©nuer les douleurs, les allergies et les troubles digestifs.\",\n+ },\n+ {\n+ text: \"Faites le choix dâun bien-ĂȘtre optimal et votre corps vous remerciera pour cette dĂ©cision qui va changer votre quotidien !\",\n+ },\n+ ],\n+ },\n+ firstCategory: [\n+ getCategoryById(\"0GestionDuPoids\").name,\n+ getCategoryById(\"1Sante\").name,\n+ getCategoryById(\"2Beaute\").name,\n+ getCategoryById(\"3BienEtre\").name,\n+ getCategoryById(\"6ProfilsParticuliers\").name,\n+ ],\n+ secondCategory: [\n+ getSecondCategoryById(\"0GestionDuPoids0CureMinceur\").text,\n+ getSecondCategoryById(\"1Sante1TroublesDigestifsIntestinauxRespiratoires\")\n+ .text,\n+ getSecondCategoryById(\"1Sante2SystemesCorps\").text,\n+ getSecondCategoryById(\"1Sante3Pathologies\").text,\n+ getSecondCategoryById(\"2Beaute1SoinsVisage\").text,\n+ getSecondCategoryById(\"3BienEtre0GestionStress\").text,\n+ getSecondCategoryById(\"3BienEtre1Energie\").text,\n+ getSecondCategoryById(\"3BienEtre2FatigueSommeil\").text,\n+ getSecondCategoryById(\"3BienEtre3Humeur\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers0Femmes\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers1Enfants\").text,\n+ ],\n+ picture: \"./img/png/product/0_1_white.png\",\n+ },\n+ {\n+ nameProduct: \"Le BB\",\n+ summary: {\n+ title: \"Le secret dâun Ă©clat intĂ©rieur et extĂ©rieur\",\n+ paragraph: [\n+ {\n+ text: \"RĂ©vĂ©lez votre Ă©clat intĂ©rieur et extĂ©rieur avec ce complĂ©ment qui offre une combinaison unique d'ingrĂ©dients pour une santĂ© optimale de vos cheveux, des ongles, de votre peau et de votre bien-ĂȘtre global.\",\n+ },\n+ {\n+ text: \"Sa formule exclusive renferme un mĂ©lange d'ingrĂ©dients qui apportent de nombreux bienfaits pour la santĂ©, en particulier si vous souhaitez complĂ©ter votre apport quotidien en vitamines. Conçu spĂ©cifiquement pour rĂ©pondre aux besoins nutritionnels des cheveux, des ongles et de la peau, le BB ne se limite pas Ă l'aspect externe. \",\n+ },\n+ {\n+ text: \"Votre bien-ĂȘtre interne bĂ©nĂ©ficiera Ă©galement des vitamines, des minĂ©raux et des bioflavonoĂŻdes contenus dans ce complĂ©ment, tous extraits naturellement de plantes.\",\n+ },\n+ {\n+ text: \"Que vous souhaitiez renforcer votre santĂ© globale ou simplement dynamiser votre routine beautĂ©, ce puissant complĂ©ment vous procurera une sensation de renouveau et de vitalitĂ©.\",\n+ },\n+ ],\n+ },\n+ firstCategory: [\n+ getCategoryById(\"1Sante\").name,\n+ getCategoryById(\"2Beaute\").name,\n+ getCategoryById(\"3BienEtre\").name,\n+ getCategoryById(\"6ProfilsParticuliers\").name,\n+ ],\n+ secondCategory: [\n+ getSecondCategoryById(\"1Sante0ProblemesCutanes\").text,\n+ getSecondCategoryById(\"1Sante2SystemesCorps\").text,\n+ getSecondCategoryById(\"2Beaute0SoinsCheveux\").text,\n+ getSecondCategoryById(\"2Beaute2SoinsCorps\").text,\n+ getSecondCategoryById(\"3BienEtre1Energie\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers1Enfants\").text,\n+ ],\n+ picture: \"./img/png/product/0_1_white.png\",\n+ },\n+ {\n+ nameProduct: \"Le BB\",\n+ summary: {\n+ title: \"Le secret dâun Ă©clat intĂ©rieur et extĂ©rieur\",\n+ paragraph: [\n+ {\n+ text: \"RĂ©vĂ©lez votre Ă©clat intĂ©rieur et extĂ©rieur avec ce complĂ©ment qui offre une combinaison unique d'ingrĂ©dients pour une santĂ© optimale de vos cheveux, des ongles, de votre peau et de votre bien-ĂȘtre global.\",\n+ },\n+ {\n+ text: \"Sa formule exclusive renferme un mĂ©lange d'ingrĂ©dients qui apportent de nombreux bienfaits pour la santĂ©, en particulier si vous souhaitez complĂ©ter votre apport quotidien en vitamines. Conçu spĂ©cifiquement pour rĂ©pondre aux besoins nutritionnels des cheveux, des ongles et de la peau, le BB ne se limite pas Ă l'aspect externe. \",\n+ },\n+ {\n+ text: \"Votre bien-ĂȘtre interne bĂ©nĂ©ficiera Ă©galement des vitamines, des minĂ©raux et des bioflavonoĂŻdes contenus dans ce complĂ©ment, tous extraits naturellement de plantes.\",\n+ },\n+ {\n+ text: \"Que vous souhaitiez renforcer votre santĂ© globale ou simplement dynamiser votre routine beautĂ©, ce puissant complĂ©ment vous procurera une sensation de renouveau et de vitalitĂ©.\",\n+ },\n+ ],\n+ },\n+ firstCategory: [\n+ getCategoryById(\"1Sante\").name,\n+ getCategoryById(\"2Beaute\").name,\n+ getCategoryById(\"3BienEtre\").name,\n+ getCategoryById(\"6ProfilsParticuliers\").name,\n+ ],\n+ secondCategory: [\n+ getSecondCategoryById(\"1Sante0ProblemesCutanes\").text,\n+ getSecondCategoryById(\"1Sante2SystemesCorps\").text,\n+ getSecondCategoryById(\"2Beaute0SoinsCheveux\").text,\n+ getSecondCategoryById(\"2Beaute2SoinsCorps\").text,\n+ getSecondCategoryById(\"3BienEtre1Energie\").text,\n+ getSecondCategoryById(\"6ProfilsParticuliers1Enfants\").text,\n+ ],\n+ picture: \"./img/png/product/0_1_white.png\",\n+ },\n+ {\n+ nameProduct: \"Le BB\",\n+ summary: {\n+ title: \"Le secret dâun Ă©clat intĂ©rieur et extĂ©rieur\",\n paragraph: [\n {\n text: \"RĂ©vĂ©lez votre Ă©clat intĂ©rieur et extĂ©rieur avec ce complĂ©ment qui offre une combinaison unique d'ingrĂ©dients pour une santĂ© optimale de vos cheveux, des ongles, de votre peau et de votre bien-ĂȘtre global.\",\n@@ -88,7 +271,5 @@ export const productList = [\n getSecondCategoryById(\"6ProfilsParticuliers1Enfants\").text,\n ],\n picture: \"./img/png/product/0_1_white.png\",\n- hoveredPicture: \"./img/png/product/0_1_vert.png\",\n- altPicture: \"Photo du produit La DĂ©tox\",\n },\n ];\ndiff --git a/frontend/src/sass/pages/_productCard.scss b/frontend/src/sass/pages/_productCard.scss\nindex 71f0017..0a0a98b 100644\n--- a/frontend/src/sass/pages/_productCard.scss\n+++ b/frontend/src/sass/pages/_productCard.scss\n@@ -1,3 +1,7 @@\n+.arrayProductCard {\n+ min-height: calc(100vh - 125px);\n+}\n+\n .bgProductCard {\n position: relative;\n z-index: 2;"}],"temperature":0,"top_p":0.1,"max_tokens":500}
â
â
â đ Commit message generated
â
â â Request failed with status code 404
I believe we don't need to have the entire text in the commit. Just including the beginning and the end of a paragraph would be sufficient and would help avoid any errors.
Any solution / permanent fix yet? It is so annoying that 400 error and throws me out of my focus and workflow each time.
What about option for using GPT 3.5-16k token model? This one can easy handle larger tokens without using the way more expensive GPT 4.0 model. It's only slighter more expensive but more convenient that it can handle larger tokens. I tried this but it raised an error that the config can not handle this model. It seems locked on either GPT3.5 or 4, nothing else?
Stale issue message
reopening, will add models with larger contexts
Opencommit Version
2.0.12
Node Version
14.21.2
NPM Version
9.6.6
What OS are you seeing the problem on?
No response
What happened?
A bug happened!When i try to generate a commit i hve this error Error: Request failed with status code 404 i tried with gpt-3.5-turbo and gpt-4
Expected Behavior
Generate a commit message
Current Behavior
Not gerating commit and trow an error oc
Possible Solution
No response
Steps to Reproduce
config openai api key
Relevant log output