di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.98k stars 318 forks source link

[Bug]: v3.1.2 doesn't work with local ollama #405

Closed ariitano closed 3 weeks ago

ariitano commented 3 weeks ago

Opencommit Version

3.1.2

Node Version

20.6.1

NPM Version

10.5.0

What OS are you seeing the problem on?

Other Linux Distro

What happened?

I upgraded to the latest version with npm installation, and my configuration (which worked perfectly with the previous version) doesn't work anymore, I'm getting asked for openAI api key while I don't use their API

Expected Behavior

COmmit generation

Current Behavior

An error message is generated

Possible Solution

Please check if changes in env variables are needed. If I downgrade to v3.0.20 it works again.

Steps to Reproduce

npm i -g opencommit@latest oco

Relevant log output

◇  📝 Commit message generated
│
└  ✖ The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
di-sukharev commented 3 weeks ago

looking into it now👁️

di-sukharev commented 3 weeks ago

what is your OCO_AI_PROVIDER var set to? @ariitano

ariitano commented 3 weeks ago

OCO_AI_PROVIDER='ollama/phi3.5:3.8b'

di-sukharev commented 3 weeks ago

there was a change, you should now set OCO_AI_PROVIDER=ollama and OCO_MODEL=phi3.5:3.8b

ariitano commented 3 weeks ago

THanks, I must have read the documentation better (or maybe give you time to write it :) )

di-sukharev commented 3 weeks ago

i'm updating the docs, thank you <3