-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Ollama provider error: Invalid URL (version 3.2.2) #416
Comments
API_URL should not be undefined |
According to the section you linked to, OCO_API_URL is optional and only needs to be set if ollama isn't running on the localhost. In the past this default value worked, now it's suddenly necessary to set it explicitly, and again, this isn't mentioned in the readme. |
ohh yeah.. you are correct, my apologies :) i will then look into it, looks like it's kinda mandatory, but should have been kept optional for OCO_AI_PROVIDER=ollama |
hmm.. but it looks like we handle this case https://github.com/di-sukharev/opencommit/blob/master/src/engine/ollama.ts#L16 so it needs a deeper look anyway @bjornsnoen if you feel like opening the PR with a fix— please do. i will myself get to it ~weekend |
I think any fix should take into account the OLLAMA_HOST env var as well. To me, the order should be:
|
I'm not sure i'm following you guys. Even after remove those API_URL lines I get error as same. ❯❯❯ cat ~/.opencommit
OCO_AI_PROVIDER=ollama
OCO_MODEL=llama3:latest
OCO_TOKENS_MAX_INPUT=40960
OCO_TOKENS_MAX_OUTPUT=4096
OCO_DESCRIPTION=false
OCO_EMOJI=false
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit
OCO_ONE_LINE_COMMIT=false
OCO_TEST_MOCK_TYPE=commit-message
OCO_GITPUSH=true
OCO_WHY=false
❯❯❯ cat ~/.opencommit_migrations
[
"00_use_single_api_key_and_url",
"01_remove_obsolete_config_keys_from_global_file",
"02_set_missing_default_values"
]%
❯❯❯ oco
┌ open-commit
│
◇ 1 staged files:
build.gradle.kts
│
◇ ✖ Failed to generate the commit message
Error: Ollama provider error: Invalid URL
at OllamaEngine.generateCommitMessage (/Users/roeniss/.nvm/versions/node/v20.11.1/lib/node_modules/opencommit/out/cli.cjs:40212:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async generateCommitMessageByDiff (/Users/roeniss/.nvm/versions/node/v20.11.1/lib/node_modules/opencommit/out/cli.cjs:45082:27)
at async generateCommitMessageFromGitDiff (/Users/roeniss/.nvm/versions/node/v20.11.1/lib/node_modules/opencommit/out/cli.cjs:45293:25)
at async trytm (/Users/roeniss/.nvm/versions/node/v20.11.1/lib/node_modules/opencommit/out/cli.cjs:45261:18)
at async commit (/Users/roeniss/.nvm/versions/node/v20.11.1/lib/node_modules/opencommit/out/cli.cjs:45458:35)
│
└ ✖ Ollama provider error: Invalid URL |
it worked after I added |
@roeniss you can add it like |
Opencommit Version
3.2.2
Node Version
20.11.1
NPM Version
10.8.3
What OS are you seeing the problem on?
Mac
What happened?
Expected Behavior
.
Current Behavior
.
Possible Solution
No response
Steps to Reproduce
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: