di-sukharev / opencommit

Generate awesome commits with AI in 1 second πŸ€―πŸ”«
https://www.npmjs.com/package/opencommit
MIT License
5.81k stars 304 forks source link

[Feature]: Support for gpt-4o #360

Closed cortex225 closed 1 month ago

cortex225 commented 1 month ago

Description

Can we have a support for model gpt-4o ?

Suggested Solution

Can we have a support for model gpt-4o ?

Alternatives

No response

Additional Context

No response

jakoberpf commented 1 month ago

We/I are/am using opencommit with gpt4o already and it works fine. Not sure if this helps as feedback.

Meowzz95 commented 1 month ago

set it like this in .opencommit and it works

OCO_MODEL=gpt-4o

cortex225 commented 1 month ago

I tried it, but I receive this message oco config set OCO_MODEL=gpt-4o β”Œ opencommit β€” config β”‚ β”” βœ– Unsupported config key OCO_MODEL: gpt-4o is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-16k' (default), 'gpt-3.5-turbo-0613' or 'gpt-3.5-turbo'

matscube commented 1 month ago

@cortex225 Please ensure that you are using the latest version of OpenCommit. The current latest version appears to be 3.0.16, which supports gpt-4o.

version check command: oco --version

If you are using the oco hook, it's important to verify that the installed oco's script version for the git hook is up-to-date. Please note that when you update OpenCommit, the hook script does not automatically update. Therefore, you will need to manually update the hook script.

git hook script: .git/hooks/prepare-commit-msg

cortex225 commented 1 month ago

@matscube yes, I have de right version oco --version 3.0.16 and I got the same message here `` InstaHr/Views/Shared/PartialViews/Dashboard/Invoices/_InvoicesBalance.cshtml β”‚ β—‡ πŸ“ Commit message generated β”‚ β”” Generated commit message: β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” πŸ’„ (InvoicesBalance.cshtml): remove unnecessary color-white class from icon to improve visual consistency πŸ’„ (InvoicesBalance.cshtml): fix indentation for better readability β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

β”‚ β”‚ β—‡ πŸ“ Commit message generated β”‚ β”” βœ– Command failed with exit code 1: git commit -m πŸ’„ (InvoicesBalance.cshtml): remove unnecessary color-white class from icon to improve visual consistency πŸ’„ (InvoicesBalance.cshtml): fix indentation for better readability β”‚ β”” βœ– Unsupported config key OCO_MODEL: gpt-4o is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-16k' (default), 'gpt-3.5-turbo-0613' or 'gpt-3.5-turbo' `

matscube commented 1 month ago

@cortex225 If possible, could you share the configuration of the config files you are using (.opencommit and local .env)? The .opencommit file I am using is as follows. Also, I am not using a local .env file. With this configuration, the oco command is working correctly.

OCO_OPENAI_API_KEY=sk-..........
OCO_MODEL=gpt-4o
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit

Additionally, would it be possible to create a new git repository and test whether it works there?

$ mkdir test-dir
$ cd test-dir
$ git init
$ echo 'test' > test
$ oco
XiaomaiTX commented 1 month ago

Hi, @cortex225

365

Waiting for review

Best regards.

di-sukharev commented 1 month ago

@cortex225 you need to check .opencommit folder in the specific version of your node's node_modules, it may be that you are using old version in e.g. node v18 instead of v20, just remove all .opencommit folders in every global node_modules packages and install opencommit from scratch

di-sukharev commented 1 month ago

366 v3.0.17 shipped

cortex225 commented 1 month ago

@di-sukharev I have node v21.7.2, And I installed opencommit from scratch, it always same result 😞

di-sukharev commented 1 month ago

@cortex225 did you look into your global node_modules? please do, there are packages for every version, remove opencommit folder inside every node version folder. then install it again

cortex225 commented 1 month ago

@di-sukharev Thanks, it's work πŸŽ‰