Comments (8)
@Nutlope The error appears to be insufficient_quota
. I had to console.log
the json
response from const json = yield response.json();
and got this:
{
json: {
error: {
message: 'You exceeded your current quota, please check your plan and billing details.',
type: 'insufficient_quota',
param: null,
code: null
}
}
}
But you need to handle this (or any other) error(s).
Stack trace:
/usr/local/lib/node_modules/aicommits/bin/aicommits.js:99
const aiCommit = json.choices[0].text;
^
TypeError: Cannot read properties of undefined (reading '0')
at /usr/local/lib/node_modules/aicommits/bin/aicommits.js:99:38
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/aicommits/bin/aicommits.js:6:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I tried with another OpenAI account where I have billing setup and got a server_error
{
json: {
error: {
message: 'The server had an error while processing your request. Sorry about that!',
type: 'server_error',
param: null,
code: null
}
}
}
I tried several times until I got a successful response, so it could be the OpenAI API having issues right now.
from aicommits.
In my case, I had to set up a payment method in my OpenAI account, and regenerate an new API Key. It worked right after.
from aicommits.
Hey @graup, thanks for opening this issue! This error typically happens when you don't have the correct value for the OpenAI env variable. I recommend you do a printenv OPENAI_API_KEY
to see what value you have it set to and verify that it matches an API key that's on your OpenAI API dashboard that you linked.
The API key should have no whitespaces and should be in the shape of sk-xxxxxxxxxxxxxxx
. Could you verify you have the correct value for the env variable, open a brand new terminal, try it out again, then let me know if the problem is still there?
from aicommits.
Thanks for your reply! I tried that, same problem. If you have no idea, I'll try checking out your repo and digging into the API response.
from aicommits.
@graup I may try to add a debugging flag to the CLI soon that shows detailed console messages so folks can debug in situations like this. In the meantime, mind trying one more thing for me?
I have a feeling it may be extra whitespace so could you do a unset OPENAI_API_KEY
to remove the env var, go directly to your .zshrc
by going to your root cd ~
then code .zshrc
to open it up, and add export OPENAI_API_KEY="sk---"
to the .zshrc
somewhere.
After all of that, open up a fresh terminal and try it one more time. If it works, then it was whitespace and I should just trim extra whitespace.
from aicommits.
Hi, I understand that you're facing the same issue that I did before. But I was able to fix it by simply restarting my terminal. Sometimes, when the terminal has been running for a while, it can start to experience some glitches or issues with its processes. So, try restarting your terminal and see if that resolves the problem for you too.
from aicommits.
The latest release should log the specific error from OpenAI
from aicommits.
OCO_OPENAI_BASE_PATH=https://api.aikey.one/v1,
Add /v1 after the API.
Source code:
...
createChatCompletion: (createChatCompletionRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/chat/completions`;
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
}),
...
from aicommits.
Related Issues (20)
- aicommits uses first the envVar instead of the env in .aicommits file HOT 1
- Include Past commits HOT 1
- Prompt shouldn't include Character limit
- Generate Message Body
- aicommits hides the output of husky HOT 1
- Option to skip precommit checks HOT 1
- Error: Too many requests HOT 1
- Extract issue name from branch and append to commit message HOT 2
- Message sanitization should not always remove newlines
- Feature: Ollama integration HOT 6
- self-signed certificate in certificate chain
- Unable to Set OpenAI API Key HOT 4
- How to setting max tokens? HOT 2
- Timeout Error in aicommits v1.11.0 on Large File Commit HOT 1
- Customize generated commit message HOT 1
- Add support for custom OpenAI base url (LocalAI integration) HOT 4
- at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
- certificate is not yet valid
- Integrate with copilot-gpt4-service
- Prompt fine-tuning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aicommits.